From 6f9b306f774d0d9f78bb8bc70754636643beaef7 Mon Sep 17 00:00:00 2001 From: pinwheeeel Date: Wed, 2 Oct 2024 23:17:07 -0400 Subject: [PATCH] undo last commit: turns out hiding usable_password didn't make much sense --- core/admin.py | 10 ---------- core/forms.py | 4 ++-- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/core/admin.py b/core/admin.py index f669e119..c3164d40 100644 --- a/core/admin.py +++ b/core/admin.py @@ -628,16 +628,6 @@ class UserAdmin(DjangoUserAdmin): form = UserAdminForm add_form = UserCreationForm - add_fieldsets = ( - ( - None, - { - "classes": ("wide",), - "fields": ("username", "password1", "password2"), # Removed usable_password field - }, - ), - ) - def get_inline_instances(self, request, obj=None): if obj and StaffMember.objects.filter(user=obj).exists(): # Add StaffMemberInline if the user has a related StaffMember diff --git a/core/forms.py b/core/forms.py index 1ae7438d..cfcd7a9b 100644 --- a/core/forms.py +++ b/core/forms.py @@ -2,7 +2,7 @@ from django import forms from django.conf import settings from django.contrib.auth.forms import UserChangeForm as ContribUserChangeForm -from django.contrib.auth.forms import UserCreationForm as ContribUserCreationForm +from django.contrib.auth.forms import AdminUserCreationForm as ContribAdminUserCreationForm from django.utils import timezone from django_select2 import forms as s2forms from martor.widgets import AdminMartorWidget @@ -290,5 +290,5 @@ class UserAdminForm(CaseInsensitiveUsernameMixin, ContribUserChangeForm): expo_notif_tokens = forms.JSONField(required=False) -class UserCreationForm(CaseInsensitiveUsernameMixin, ContribUserCreationForm): +class UserCreationForm(CaseInsensitiveUsernameMixin, ContribAdminUserCreationForm): pass