Skip to content

Commit

Permalink
[#2760] Change label text in template not controller
Browse files Browse the repository at this point in the history
  • Loading branch information
k-nut committed May 24, 2016
1 parent 0c09183 commit b9dab31
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions ckan/controllers/user.py
Expand Up @@ -315,10 +315,6 @@ def edit(self, id=None, data=None, errors=None, error_summary=None):
c.is_myself = True
c.show_email_notifications = asbool(
config.get('ckan.activity_streams_email_notifications'))
if authz.is_sysadmin(c.user):
vars['oldpassword_label'] = 'Sysadmin password'
else:
vars['oldpassword_label'] = 'Old password'
c.form = render(self.edit_user_form, extra_vars=vars)

return render('user/edit.html')
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/user/edit_user_form.html
Expand Up @@ -24,7 +24,7 @@

<fieldset>
<legend>{{ _('Change password') }}</legend>
{{ form.input('old_password', type='password', label=_(oldpassword_label), id='field-password', value=data.oldpassword, error=errors.oldpassword, classes=['control-medium'], attrs={'autocomplete': 'off'} ) }}
{{ form.input('old_password', type='password', label=_('Sysadmin password') if c.is_sysadmin else _('Old password'), id='field-password', value=data.oldpassword, error=errors.oldpassword, classes=['control-medium'], attrs={'autocomplete': 'off'} ) }}

{{ form.input('password1', type='password', label=_('Password'), id='field-password', value=data.password1, error=errors.password1, classes=['control-medium'], attrs={'autocomplete': 'off'} ) }}

Expand Down

0 comments on commit b9dab31

Please sign in to comment.