diff --git a/kallithea/controllers/admin/my_account.py b/kallithea/controllers/admin/my_account.py --- a/kallithea/controllers/admin/my_account.py +++ b/kallithea/controllers/admin/my_account.py @@ -155,7 +155,11 @@ class MyAccountController(BaseController def my_account_password(self): c.active = 'password' self.__load_data() - if request.POST: + + managed_fields = auth_modules.get_managed_fields(c.user) + c.can_change_password = 'password' not in managed_fields + + if request.POST and c.can_change_password: _form = PasswordChangeForm(self.authuser.username)() try: form_result = _form.to_python(request.POST) diff --git a/kallithea/templates/admin/my_account/my_account_password.html b/kallithea/templates/admin/my_account/my_account_password.html --- a/kallithea/templates/admin/my_account/my_account_password.html +++ b/kallithea/templates/admin/my_account/my_account_password.html @@ -1,4 +1,7 @@
${_('Change Your Account Password')}
+ +%if c.can_change_password: + ${h.form(url('my_account_password'), method='post')}
@@ -36,3 +39,9 @@
${h.end_form()} + +%else: + +${_('This account is managed with %s and the password cannot be changed here') % c.user.extern_type} + +%endif