Skip to content

Commit

Permalink
Merge branch 'wlmac:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
pinwheeeel authored Oct 3, 2024
2 parents 15a5048 + 754a4e0 commit 486856f
Show file tree
Hide file tree
Showing 7 changed files with 1,281 additions and 1,051 deletions.
6 changes: 4 additions & 2 deletions core/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
TagSuperuserAdminForm,
TermAdminForm,
UserAdminForm,
UserCreationAdminForm,
UserCreationForm,
)
from .models import Comment, StaffMember
from .utils.actions import (
Expand All @@ -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,
Expand Down Expand Up @@ -156,6 +157,7 @@ class OrganizationAdmin(admin.ModelAdmin):
OrganizationURLInline,
]
actions = [
set_club_open,
set_club_unactive,
set_club_active,
reset_club_president,
Expand Down Expand Up @@ -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():
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 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
Expand Down Expand Up @@ -290,5 +290,5 @@ class UserAdminForm(CaseInsensitiveUsernameMixin, ContribUserChangeForm):
expo_notif_tokens = forms.JSONField(required=False)


class UserCreationAdminForm(CaseInsensitiveUsernameMixin, ContribAdminUserCreationForm):
class UserCreationForm(CaseInsensitiveUsernameMixin, ContribUserCreationForm):
pass
12 changes: 7 additions & 5 deletions core/management/commands/add_clubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,15 @@ def handle(self, *args, **options):
"extra_content": time_and_place + "\n\n" + social_links,
"show_members": True,
"is_active": True,
"is_open": False,
"is_open": True,
"applications_open": True,
} # this singular comma gave me a run for my money. i have lost my family, my wealth, my sanity, and my soul from the inclusion of this character.
# fmt: on

# remove all non-alphanumeric or whitespace characters (a-z, A-Z, 0-9, space) and then replace spaces with dashes
slug = re.sub(r"[^a-zA-Z0-9\s]", "", organization_name.strip().casefold()).replace(" ", "-")
slug = re.sub(
r"[^a-zA-Z0-9\s]", "", organization_name.strip().casefold()
).replace(" ", "-")

if not Organization.objects.filter(slug=slug).exists():
slug = self.get_corrected_slug_or_not(organization_name, slug)
Expand All @@ -164,7 +167,7 @@ def handle(self, *args, **options):
except IntegrityError as IE:
self.error(IE.__traceback__)
self.stdout.write()

self.warn(
f"Skipped {len(skipped_orgs)} organizations: \n\t{'\n\t'.join(skipped_orgs)}"
)
Expand Down Expand Up @@ -214,4 +217,3 @@ def get_corrected_slug_or_not(self, organization_name: str, slug: str) -> str:
self.error(
f"\tCould not find an organization with the slug '{new_slug}'. Please try again or leave blank to create a club."
)

148 changes: 84 additions & 64 deletions core/static/core/img/tv/data.hcl
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
group "A" {
x = 220
y = 550
rotate = -90
#colour = "#b59040"
group "A" { # Orange group, now on the right side
x = 930
y = 500
rotate = 90
colour = "#decaa1"

desk "1-2" {
Expand All @@ -21,136 +20,157 @@ group "A" {
x = 0
y = -105 * 3
}
desk "9-10" {
x = 0
y = -105 * 4
}
}

group "B" {
x = 313
y = 600
#colour = "#25bb9d"
group "B" { # Cyan group, bottom most
x = 230
y = 620
colour = "#93ead8"

desk "9" {
desk "23-24" {
x = 105 * 0
y = 0
}
desk "10-11" {
desk "25-26" {
x = 105 * 1
y = 0
}
desk "12-13" {
desk "27-28" {
x = 105 * 2
y = 0
}
desk "14-15" {
desk "29-30" {
x = 105 * 3
y = 0
}
desk "16-17" {
desk "31-32" {
x = 105 * 4
y = 0
}
desk "18-54" {
desk "33" {
x = 105 * 5
y = 0
}
}

group "C" {
x = 410
group "C" { # Yellow group, left
x = 230
y = 240
#colour = "#b1ac14"
colour = "#f1ee84"

desk "34-35" {
x = 20
y = 70
desk "54-55" {
x = 116
y = 55
rotate = 90
}
desk "38-39" {
x = 105 * 0
y = 105 + 70
desk "56-57" {
x = 116
y = 145
rotate = 90
}
desk "40-41" {
x = 105 * 1
y = 105 + 70
desk "58-59" {
x = 150 // Adjusted to prevent overlap
y = 235
}
desk "60-61" {
x = 60 // Adjusted to prevent overlap
y = 235
}
desk "37-36" {
x = 170
y = 160
desk "62-63" {
x = 184 // Adjusted to prevent overlap
y = 145
rotate = -90
}
desk "32-33" {
x = 105 * 1
y = 0
desk "64-65" {
x = 184 // Adjusted to prevent overlap
y = 235
rotate = -90
}
desk "30-31" {
x = 105 * 0
desk "52-53" {
x = 150 // Adjusted to prevent overlap
y = 0
}
desk "42-43" {
x = 360
y = 70
rotate = 90
desk "50-51" {
x = 60 // Adjusted to prevent overlap
y = 0
}
}

group "D" {
x = 750
group "D" { # Green group, right
x = 570
y = 240
#colour = "#35ac62"
colour = "#9de1b7"

desk "48-49" {
x = 105 * 0
y = 105 + 70
desk "34-35" {
x = 116
y = 145
rotate = 90
}
desk "50-51" {
x = 105 * 1
y = 105 + 70
desk "36-37" {
x = 150
y = 235
}
desk "38-39" {
x = 60 // Adjusted to prevent overlap
y = 235
}
desk "40-41" {
x = 184 // Adjusted to prevent overlap
y = 145
rotate = -90
}
desk "53-52" {
x = 170
y = 160
desk "42-43" {
x = 184 // Adjusted to prevent overlap
y = 235
rotate = -90
}
desk "44-45" {
x = 116 // Adjusted to prevent overlap
y = 55
rotate = 90
}

desk "46-47" {
x = 105 * 1
x = 60 // Adjusted to prevent overlap
y = 0
}
desk "44-45" {
x = 105 * 0
desk "48-49" {
x = 150 // Adjusted to prevent overlap
y = 0
}
}

group "E" {
x = 313
group "E" { # Top Red group
x = 230
y = 50
#colour = "#997075"
colour = "#cab5b7"

desk "19-20" {
desk "11-12" {
x = 105 * 0
y = 0
}
desk "21-22" {
desk "13-14" {
x = 105 * 1
y = 0
}
desk "23-24" {
desk "15-16" {
x = 105 * 2
y = 0
}
desk "25-26" {
desk "17-18" {
x = 105 * 3
y = 0
}
desk "27-28" {
desk "19-20" {
x = 105 * 4
y = 0
}
desk "29" {
desk "21-22" {
x = 105 * 5
y = 0
}
}
}
Loading

0 comments on commit 486856f

Please sign in to comment.