Make use of 'admin.register' decorator in admin.py

This commit is contained in:
Saurabh Kumar 2015-05-09 22:23:36 +05:30
parent b60e13ed31
commit 2d81d61167

View File

@ -27,9 +27,7 @@ class MyUserCreationForm(UserCreationForm):
raise forms.ValidationError(self.error_messages['duplicate_username'])
@admin.register(User)
class UserAdmin(AuthUserAdmin):
form = MyUserChangeForm
add_form = MyUserCreationForm
admin.site.register(User, UserAdmin)