DJ1.9 compat field.related

This commit is contained in:
Marc Aymerich 2016-04-30 15:10:39 +00:00
parent 21ff73afea
commit d4d9f6a49a
4 changed files with 21 additions and 16 deletions

View File

@ -112,7 +112,7 @@ class DatabaseUserChangeForm(forms.ModelForm):
password = ReadOnlySQLPasswordHashField(label=_("Password"), password = ReadOnlySQLPasswordHashField(label=_("Password"),
help_text=_("Raw passwords are not stored, so there is no way to see " help_text=_("Raw passwords are not stored, so there is no way to see "
"this user's password, but you can change the password " "this user's password, but you can change the password "
"using <a href=\"password/\">this form</a>.")) "using <a href=\"../password/\">this form</a>."))
class Meta: class Meta:
model = DatabaseUser model = DatabaseUser

View File

@ -60,7 +60,7 @@ class SaaSPasswordForm(SaaSBaseForm):
], ],
help_text=_("Passwords are not stored, so there is no way to see this " help_text=_("Passwords are not stored, so there is no way to see this "
"service's password, but you can change the password using " "service's password, but you can change the password using "
"<a href=\"password/\">this form</a>.")) "<a href=\"../password/\">this form</a>."))
password1 = forms.CharField(label=_("Password"), password1 = forms.CharField(label=_("Password"),
widget=forms.PasswordInput(attrs={'autocomplete': 'off'}), widget=forms.PasswordInput(attrs={'autocomplete': 'off'}),
validators=[validators.validate_password]) validators=[validators.validate_password])

View File

@ -62,7 +62,7 @@ class UserChangeForm(forms.ModelForm):
password = auth_forms.ReadOnlyPasswordHashField(label=_("Password"), password = auth_forms.ReadOnlyPasswordHashField(label=_("Password"),
help_text=_("Raw passwords are not stored, so there is no way to see " help_text=_("Raw passwords are not stored, so there is no way to see "
"this user's password, but you can change it by " "this user's password, but you can change it by "
"using <a href=\"password/\">this form</a>.")) "using <a href=\"../password/\">this form</a>."))
def clean_password(self): def clean_password(self):
# Regardless of what the user provides, return the initial value. # Regardless of what the user provides, return the initial value.
@ -75,7 +75,7 @@ class NonStoredUserChangeForm(forms.ModelForm):
password = forms.CharField(label=_("Password"), required=False, password = forms.CharField(label=_("Password"), required=False,
widget=SpanWidget(display='<strong>Unknown password</strong>'), widget=SpanWidget(display='<strong>Unknown password</strong>'),
help_text=_("This service's password is not stored, so there is no way to see it, " help_text=_("This service's password is not stored, so there is no way to see it, "
"but you can change it using <a href=\"password/\">this form</a>.")) "but you can change it using <a href=\"../password/\">this form</a>."))
class ReadOnlyFormMixin(object): class ReadOnlyFormMixin(object):

View File

@ -49,15 +49,20 @@
<div style="max-width: 1370px; margin:auto; padding-top:4px;"> <div style="max-width: 1370px; margin:auto; padding-top:4px;">
<div id="branding"><a href="/admin/"></a><h1 id="site-name"><a href="/admin/">{{ ORCHESTRA_SITE_VERBOSE_NAME }}<span class="version">0.0.1a1</span></a></h1></div> <div id="branding"><a href="/admin/"></a><h1 id="site-name"><a href="/admin/">{{ ORCHESTRA_SITE_VERBOSE_NAME }}<span class="version">0.0.1a1</span></a></h1></div>
{% for item in menu.children %}{% admin_tools_render_menu_item item forloop.counter %}{% endfor %} {% for item in menu.children %}{% admin_tools_render_menu_item item forloop.counter %}{% endfor %}
<form action="{% url 'admin:orchestra_search_view' %}" method="get" name="top_search" style="display: inline;"> <li class="menu-item" style="padding-left:15px;padding-top:3px;">
<input type="text" id="searchbox" style="margin-left:15px;margin-top:3px;" name="q" <div style="position:absolute">
<form action="{% url 'admin:orchestra_search_view' %}" method="get" name="top_search" >
<input type="text" id="searchbox" name="q"
placeholder="Search" size="25" value="{{ query }}" placeholder="Search" size="25" value="{{ query }}"
{% if search_autofocus or app_list %}autofocus="autofocus"{% endif %} {% if search_autofocus or app_list %}autofocus="autofocus"{% endif %}
title="Use 'accountname!' for account direct access title="Use 'accountname!' for account direct access
Use 'service:word' for searching on specific services Use 'service:word' for searching on specific services
Use 'fieldname=word' for searching on specific fields"> Use 'fieldname=word' for searching on specific fields">
</form> </form>
<span style="float:right;color:grey;margin:15px;font-size:13px;"> </div>
</li>
<li class="menu-item"></li>
<span style="float:right;color:grey;margin:15px;font-size:13px;position:relative;white-space:nowrap;">
{% url 'admin:accounts_account_change' user.pk as user_change_url %} {% url 'admin:accounts_account_change' user.pk as user_change_url %}
<a href="{{ user_change_url }}" style="color:#555;"><strong>{% filter force_escape %}{% firstof user.get_short_name user.username %}{% endfilter %}</strong></a> <a href="{{ user_change_url }}" style="color:#555;"><strong>{% filter force_escape %}{% firstof user.get_short_name user.username %}{% endfilter %}</strong></a>
<a href="{% url 'admin:password_change' %}" style="color:#555;">Change password</a> / <a href="{% url 'admin:logout' %}" style="color:#555;">Log out</a></span> <a href="{% url 'admin:password_change' %}" style="color:#555;">Change password</a> / <a href="{% url 'admin:logout' %}" style="color:#555;">Log out</a></span>