aboutsummaryrefslogtreecommitdiffstats
path: root/pyblackbird_cc/users/admin.py
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-10-15 21:01:31 +0100
committerMatthew Lemon <y@yulqen.org>2024-10-15 21:01:31 +0100
commiteeaddb27560d723ca7d61359744ceb2709fccd2d (patch)
tree04ddbc49ae7b73d5f5a9e1716d7227aecd3b9f85 /pyblackbird_cc/users/admin.py
parent7a3044c859043837e6c7c95bb4894d04e9b2cbc2 (diff)
Renamed from pyblackbird_cc to alphabetlearning - everywhere
Diffstat (limited to 'pyblackbird_cc/users/admin.py')
-rw-r--r--pyblackbird_cc/users/admin.py49
1 files changed, 0 insertions, 49 deletions
diff --git a/pyblackbird_cc/users/admin.py b/pyblackbird_cc/users/admin.py
deleted file mode 100644
index 04da035..0000000
--- a/pyblackbird_cc/users/admin.py
+++ /dev/null
@@ -1,49 +0,0 @@
-from django.conf import settings
-from django.contrib import admin
-from django.contrib.auth import admin as auth_admin
-from django.contrib.auth.decorators import login_required
-from django.utils.translation import gettext_lazy as _
-
-from .forms import UserAdminChangeForm
-from .forms import UserAdminCreationForm
-from .models import User
-
-if settings.DJANGO_ADMIN_FORCE_ALLAUTH:
- # Force the `admin` sign in process to go through the `django-allauth` workflow:
- # https://docs.allauth.org/en/latest/common/admin.html#admin
- admin.site.login = login_required(admin.site.login) # type: ignore[method-assign]
-
-
-@admin.register(User)
-class UserAdmin(auth_admin.UserAdmin):
- form = UserAdminChangeForm
- add_form = UserAdminCreationForm
- fieldsets = (
- (None, {"fields": ("email", "password")}),
- (_("Personal info"), {"fields": ("name",)}),
- (
- _("Permissions"),
- {
- "fields": (
- "is_active",
- "is_staff",
- "is_superuser",
- "groups",
- "user_permissions",
- ),
- },
- ),
- (_("Important dates"), {"fields": ("last_login", "date_joined")}),
- )
- list_display = ["email", "name", "is_superuser"]
- search_fields = ["name"]
- ordering = ["id"]
- add_fieldsets = (
- (
- None,
- {
- "classes": ("wide",),
- "fields": ("email", "password1", "password2"),
- },
- ),
- )