fix merge errors

This commit is contained in:
Oskar Hahn 2012-08-15 11:01:38 +02:00
parent b7a0e83c68
commit 9c031768f8
2 changed files with 2 additions and 15 deletions

View File

@ -24,21 +24,6 @@ class UserCreateForm(forms.ModelForm, CssClassMixin):
groups = forms.ModelMultipleChoiceField( groups = forms.ModelMultipleChoiceField(
queryset=Group.objects.exclude(name__iexact='anonymous'), queryset=Group.objects.exclude(name__iexact='anonymous'),
label=_("User groups"), required=False) label=_("User groups"), required=False)
is_active = forms.BooleanField(label=_("Active"), required=False,
initial=True)
class Meta:
model = User
exclude = ('username', 'password', 'is_staff', 'is_superuser',
'last_login', 'date_joined', 'user_permissions')
class UserEditForm(forms.ModelForm, CssClassMixin):
first_name = forms.CharField(label=_("First name"))
last_name = forms.CharField(label=_("Last name"))
groups = forms.ModelMultipleChoiceField(queryset=Group.objects.all(),
label=_("User groups"), required=False)
is_active = forms.BooleanField(label=_("Active"), required=False)
class Meta: class Meta:
model = User model = User
@ -111,6 +96,7 @@ class UsersettingsForm(forms.ModelForm, CssClassMixin):
model = User model = User
fields = ('username', 'first_name', 'last_name', 'email') fields = ('username', 'first_name', 'last_name', 'email')
class UserImportForm(forms.Form, CssClassMixin): class UserImportForm(forms.Form, CssClassMixin):
csvfile = forms.FileField(widget=forms.FileInput(attrs={'size': '50'}), csvfile = forms.FileField(widget=forms.FileInput(attrs={'size': '50'}),
label=_("CSV File")) label=_("CSV File"))

View File

@ -151,6 +151,7 @@ class UserCreateView(CreateView):
form.cleaned_data['last_name']) form.cleaned_data['last_name'])
if not self.object.default_password: if not self.object.default_password:
self.object.default_password = gen_password() self.object.default_password = gen_password()
self.object.set_password(self.object.default_password)
class UserUpdateView(UpdateView): class UserUpdateView(UpdateView):