Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonLovesDoggo committed Oct 9, 2024
2 parents 09ca36b + 623a89d commit 4ed435c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
6 changes: 2 additions & 4 deletions core/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
TagSuperuserAdminForm,
TermAdminForm,
UserAdminForm,
UserCreationForm,
UserCreationAdminForm,
)
from .models import Comment, StaffMember
from .utils.actions import (
Expand All @@ -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,
Expand Down Expand Up @@ -157,7 +156,6 @@ class OrganizationAdmin(admin.ModelAdmin):
OrganizationURLInline,
]
actions = [
set_club_open,
set_club_unactive,
set_club_active,
reset_club_president,
Expand Down Expand Up @@ -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():
Expand Down
4 changes: 2 additions & 2 deletions core/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -290,5 +290,5 @@ class UserAdminForm(CaseInsensitiveUsernameMixin, ContribUserChangeForm):
expo_notif_tokens = forms.JSONField(required=False)


class UserCreationForm(CaseInsensitiveUsernameMixin, ContribUserCreationForm):
class UserCreationAdminForm(CaseInsensitiveUsernameMixin, ContribAdminUserCreationForm):
pass
6 changes: 3 additions & 3 deletions core/models/course.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ 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()) or target_date.weekday() >= 5
): # TODO: check for pa days
return None
return methods[tf.get("day_num_method", "consecutive")](tf, target_date)

Expand Down
2 changes: 1 addition & 1 deletion core/views/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 4ed435c

Please sign in to comment.