aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/users/admin.py
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2020-01-19 15:57:06 +0000
committerMatthew Lemon <lemon@matthewlemon.com>2020-01-19 15:57:06 +0000
commit9d76a3c52b8310726ec09e0262813f0438c21df6 (patch)
tree4acf47dce6c3aa75f8ad7c5cb56fe6486c2d64a7 /ctrack/users/admin.py
init commit - from cookiecutter
Diffstat (limited to 'ctrack/users/admin.py')
-rw-r--r--ctrack/users/admin.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/ctrack/users/admin.py b/ctrack/users/admin.py
new file mode 100644
index 0000000..120cc64
--- /dev/null
+++ b/ctrack/users/admin.py
@@ -0,0 +1,17 @@
+from django.contrib import admin
+from django.contrib.auth import admin as auth_admin
+from django.contrib.auth import get_user_model
+
+from ctrack.users.forms import UserChangeForm, UserCreationForm
+
+User = get_user_model()
+
+
+@admin.register(User)
+class UserAdmin(auth_admin.UserAdmin):
+
+ form = UserChangeForm
+ add_form = UserCreationForm
+ fieldsets = (("User", {"fields": ("name",)}),) + auth_admin.UserAdmin.fieldsets
+ list_display = ["username", "name", "is_superuser"]
+ search_fields = ["name"]