From c4c8683d39ca3e6e1b7647c911ac8d39b540c81a Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Wed, 18 Mar 2015 13:18:03 +0100 Subject: [PATCH 2/2] Make UserEditForm of the manager handle custom attributes (fixes #6766) --- src/authentic2/manager/forms.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/authentic2/manager/forms.py b/src/authentic2/manager/forms.py index 2e785b1..5c97fc2 100644 --- a/src/authentic2/manager/forms.py +++ b/src/authentic2/manager/forms.py @@ -1,26 +1,27 @@ from django.utils.translation import ugettext_lazy as _ from django import forms from authentic2.compat import get_user_model +from authentic2.forms import UserAttributeFormMixin from . import utils, fields class RoleAddForm(forms.Form): name = forms.CharField( label=_('Role name')) def save(self): return utils.role_add(self.cleaned_data['name']) class ChooseUserForm(forms.Form): ref = fields.ChooseUserField(label=_('user')) -class UserEditForm(forms.ModelForm): +class UserEditForm(UserAttributeFormMixin, forms.ModelForm): groups = fields.GroupsField(required=False) class Meta: model = get_user_model() fields = [ 'username', 'first_name', 'last_name', 'email', 'groups'] -- 1.9.1