From 7c7ef2f24238f7efca11188d2a155ec4a16e30bd Mon Sep 17 00:00:00 2001 From: Oliver Ni Date: Sat, 16 Sep 2023 02:50:32 -0700 Subject: [PATCH] Format code --- hknweb/admin.py | 2 +- hknweb/candidate/admin/announcement.py | 1 - hknweb/candidate/admin/bitbyteactivity.py | 1 - hknweb/candidate/admin/officer_challenge.py | 1 - hknweb/coursesemester/models.py | 1 + hknweb/events/admin/event.py | 1 - hknweb/events/admin/rsvp.py | 1 - hknweb/utils.py | 1 - 8 files changed, 2 insertions(+), 7 deletions(-) diff --git a/hknweb/admin.py b/hknweb/admin.py index 6bf2a6cf..e95310f1 100644 --- a/hknweb/admin.py +++ b/hknweb/admin.py @@ -21,6 +21,7 @@ # Unregister the provided model admin admin.site.unregister(User) + # Register out own model admin, based on the default UserAdmin @admin.register(User) class CustomUserAdmin(UserAdmin): @@ -124,7 +125,6 @@ def provision_candidate_accounts(self, request): class AnnouncementAdmin(admin.ModelAdmin): - # NOTE: release_date is not readonly because we can reuse announcements from past semesters # The VP can just change the date and release it again fields = ["title", "text", "visible", "release_date"] diff --git a/hknweb/candidate/admin/announcement.py b/hknweb/candidate/admin/announcement.py index dfbbad11..ab87d8b4 100644 --- a/hknweb/candidate/admin/announcement.py +++ b/hknweb/candidate/admin/announcement.py @@ -5,7 +5,6 @@ @admin.register(Announcement) class AnnouncementAdmin(admin.ModelAdmin): - # NOTE: release_date is not readonly because we can reuse announcements from past semesters # The VP can just change the date and release it again fields = ["title", "text", "visible", "release_date"] diff --git a/hknweb/candidate/admin/bitbyteactivity.py b/hknweb/candidate/admin/bitbyteactivity.py index b9eb8ab8..9b3247ef 100644 --- a/hknweb/candidate/admin/bitbyteactivity.py +++ b/hknweb/candidate/admin/bitbyteactivity.py @@ -5,7 +5,6 @@ @admin.register(BitByteActivity) class BitByteActivityAdmin(admin.ModelAdmin): - fields = ["participants", "confirmed", "proof", "notes", "request_date"] readonly_fields = ["request_date"] list_display = ( diff --git a/hknweb/candidate/admin/officer_challenge.py b/hknweb/candidate/admin/officer_challenge.py index 2dd75189..d1cec54c 100644 --- a/hknweb/candidate/admin/officer_challenge.py +++ b/hknweb/candidate/admin/officer_challenge.py @@ -6,7 +6,6 @@ @admin.register(OffChallenge) class OffChallengeAdmin(admin.ModelAdmin): - fields = [ "requester", "officer", diff --git a/hknweb/coursesemester/models.py b/hknweb/coursesemester/models.py index ab149453..9b403445 100644 --- a/hknweb/coursesemester/models.py +++ b/hknweb/coursesemester/models.py @@ -1,5 +1,6 @@ from django.db import models + # Create your models here. class Department(models.Model): abbreviated_name = models.CharField( diff --git a/hknweb/events/admin/event.py b/hknweb/events/admin/event.py index 00f384bb..4551849f 100644 --- a/hknweb/events/admin/event.py +++ b/hknweb/events/admin/event.py @@ -7,7 +7,6 @@ @admin.register(Event) class EventAdmin(admin.ModelAdmin): - fields = [ "name", "start_time", diff --git a/hknweb/events/admin/rsvp.py b/hknweb/events/admin/rsvp.py index cf957cd7..dc77db59 100644 --- a/hknweb/events/admin/rsvp.py +++ b/hknweb/events/admin/rsvp.py @@ -8,7 +8,6 @@ @admin.register(Rsvp) class RsvpAdmin(admin.ModelAdmin): - fields = ["event", "user", "confirmed", "comment", "created_at"] readonly_fields = ["created_at"] list_display = ("event", "user", "full_name", "confirmed", "created_at") diff --git a/hknweb/utils.py b/hknweb/utils.py index e9de465e..846fb3da 100644 --- a/hknweb/utils.py +++ b/hknweb/utils.py @@ -210,7 +210,6 @@ def markdownify(text): # Sanitize html if wanted if getattr(settings, "MARKDOWNIFY_BLEACH", True): - cleaner = bleach.Cleaner( tags=whitelist_tags, attributes=whitelist_attrs,