Revision 36f1eabb

b/snf-astakos-app/astakos/im/forms.py
1080 1080
        password, email = True, True
1081 1081
        profile = super(ExtendedProfileForm, self).is_valid()
1082 1082
        if profile and self.cleaned_data.get('change_password', None):
1083

  
1083
            self.password_change_form.fields['new_password1'].required = True
1084
            self.password_change_form.fields['new_password2'].required = True
1084 1085
            password = self.password_change_form.is_valid()
1085 1086
            self.save_extra_forms.append('password')
1086 1087
        if profile and self.cleaned_data.get('change_email'):
b/snf-astakos-app/astakos/im/tests/auth.py
321 321
        self.assertTrue(user.has_auth_provider('shibboleth'))
322 322
        self.assertTrue(user.check_password('111'))
323 323
        self.assertTrue(user.has_usable_password())
324

  
325
        # change password via profile form
326
        r = client.post(ui_url("profile"), {
327
            'old_password': '111',
328
            'new_password': '',
329
            'new_password2': '',
330
            'change_password': 'on',
331
        }, follow=False)
332
        self.assertEqual(r.status_code, 200)
333
        self.assertFalse(r.context['profile_form'].is_valid())
334

  
324 335
        self.client.logout()
325 336

  
326 337
        # now we can login

Also available in: Unified diff