From 693e0b3e49b2890a571715adc18c2a36cc9d0fab Mon Sep 17 00:00:00 2001 From: pinwheeeel Date: Thu, 3 Oct 2024 17:29:36 -0400 Subject: [PATCH] fix banner clock during days with non instructional events --- core/admin.py | 6 ++++-- core/forms.py | 4 ++-- core/models/course.py | 4 +--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/core/admin.py b/core/admin.py index a1753690..d7f64b41 100644 --- a/core/admin.py +++ b/core/admin.py @@ -23,7 +23,7 @@ TagSuperuserAdminForm, TermAdminForm, UserAdminForm, - UserCreationAdminForm, + UserCreationForm, ) from .models import Comment, StaffMember from .utils.actions import ( @@ -34,6 +34,7 @@ reset_club_president, send_notif_singleday, send_test_notif, + set_club_open, set_club_active, set_club_unactive, set_post_archived, @@ -156,6 +157,7 @@ class OrganizationAdmin(admin.ModelAdmin): OrganizationURLInline, ] actions = [ + set_club_open, set_club_unactive, set_club_active, reset_club_president, @@ -626,7 +628,7 @@ class UserAdmin(DjangoUserAdmin): ] actions = [send_test_notif, send_notif_singleday] form = UserAdminForm - add_form = UserCreationAdminForm + add_form = UserCreationForm 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 e10bf8ca..1ae7438d 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 AdminUserCreationForm as ContribAdminUserCreationForm +from django.contrib.auth.forms import UserCreationForm as ContribUserCreationForm 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 UserCreationAdminForm(CaseInsensitiveUsernameMixin, ContribAdminUserCreationForm): +class UserCreationForm(CaseInsensitiveUsernameMixin, ContribUserCreationForm): pass diff --git a/core/models/course.py b/core/models/course.py index 87f43d60..91a73972 100644 --- a/core/models/course.py +++ b/core/models/course.py @@ -51,9 +51,7 @@ def day_num(self, target_date=None): "calendar_days": self.__day_num_calendar_days, } target_date = utils.get_localdate(date=target_date, time=[23, 59, 59]) - if not self.is_current(target_date.date()) or not self.day_is_instructional( - target_date - ): + if not self.is_current(target_date.date()): return None return methods[tf.get("day_num_method", "consecutive")](tf, target_date)