From 97977178489f2f2a97b7358b31c17c42ae4d3621 Mon Sep 17 00:00:00 2001 From: pinwheeeel Date: Thu, 3 Oct 2024 20:25:05 -0400 Subject: [PATCH] whered my commits go :( --- core/admin.py | 6 ++---- core/forms.py | 4 ++-- core/views/user.py | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/core/admin.py b/core/admin.py index d7f64b41..a1753690 100644 --- a/core/admin.py +++ b/core/admin.py @@ -23,7 +23,7 @@ TagSuperuserAdminForm, TermAdminForm, UserAdminForm, - UserCreationForm, + UserCreationAdminForm, ) from .models import Comment, StaffMember from .utils.actions import ( @@ -34,7 +34,6 @@ reset_club_president, send_notif_singleday, send_test_notif, - set_club_open, set_club_active, set_club_unactive, set_post_archived, @@ -157,7 +156,6 @@ class OrganizationAdmin(admin.ModelAdmin): OrganizationURLInline, ] actions = [ - set_club_open, set_club_unactive, set_club_active, reset_club_president, @@ -628,7 +626,7 @@ class UserAdmin(DjangoUserAdmin): ] actions = [send_test_notif, send_notif_singleday] form = UserAdminForm - add_form = UserCreationForm + add_form = UserCreationAdminForm def get_inline_instances(self, request, obj=None): if obj and StaffMember.objects.filter(user=obj).exists(): diff --git a/core/forms.py b/core/forms.py index 1ae7438d..e10bf8ca 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 UserCreationAdminForm(CaseInsensitiveUsernameMixin, ContribAdminUserCreationForm): pass diff --git a/core/views/user.py b/core/views/user.py index c12a0962..3ceb89d9 100644 --- a/core/views/user.py +++ b/core/views/user.py @@ -43,7 +43,7 @@ def get_context_data(self, **kwargs): class ProfileUpdate(LoginRequiredMixin, UpdateView, mixins.TitleMixin): model = models.User - fields = ["bio", "first_name", "last_name", "graduating_year"] + fields = ["bio", "username", "first_name", "last_name", "graduating_year"] template_name = "core/profile/update.html" success_url = reverse_lazy("profile_redirect") title = "Update Profile"