Skip to content

Commit 51c00ac

Browse files
chore: fix linting errors
1 parent e4420ba commit 51c00ac

File tree

5 files changed

+24
-20
lines changed

5 files changed

+24
-20
lines changed

intranet/apps/announcements/views.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,13 @@
1515
from ..groups.models import Group
1616
from .forms import AnnouncementAdminForm, AnnouncementEditForm, AnnouncementForm, AnnouncementRequestForm, ClubAnnouncementForm
1717
from .models import Announcement, AnnouncementRequest
18-
from .notifications import (admin_request_announcement_email, announcement_approved_email, announcement_posted_email, announcement_posted_twitter,
19-
request_announcement_email)
18+
from .notifications import (
19+
admin_request_announcement_email,
20+
announcement_approved_email,
21+
announcement_posted_email,
22+
announcement_posted_twitter,
23+
request_announcement_email,
24+
)
2025

2126
logger = logging.getLogger(__name__)
2227

intranet/apps/eighth/forms/activities.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ def __init__(self, *args, **kwargs):
1515
self.fields["subscriptions_enabled"].label = "Enable club announcements"
1616
self.fields["subscriptions_enabled"].help_text = "Allow students to subscribe to receive announcements for this activity through Ion."
1717
self.fields["club_sponsors"].label = "Teacher moderators"
18-
self.fields["club_sponsors"].help_text = (
19-
"Teacher moderators can post and manage this club's announcements. You should include club sponsors here."
20-
)
18+
self.fields[
19+
"club_sponsors"
20+
].help_text = "Teacher moderators can post and manage this club's announcements. You should include club sponsors here."
2121
self.fields["officers"].label = "Student officers"
2222
self.fields["officers"].help_text = "Student officers can send club announcements to subscribers."
2323

intranet/apps/eighth/forms/admin/activities.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
from __future__ import annotations
2+
13
import logging
2-
from typing import List # noqa
34

45
from django import forms, http
56
from django.contrib.auth import get_user_model
@@ -11,7 +12,7 @@
1112

1213

1314
class ActivityDisplayField(forms.ModelChoiceField):
14-
cancelled_acts = None # type: List[EighthActivity]
15+
cancelled_acts: list[EighthActivity] | None = None
1516

1617
def __init__(self, *args, **kwargs):
1718
if "block" in kwargs:
@@ -144,9 +145,9 @@ def __init__(self, *args, **kwargs):
144145
self.fields["subscriptions_enabled"].label = "Enable club announcements"
145146
self.fields["subscriptions_enabled"].help_text = "Allow students to subscribe to receive announcements for this activity through Ion."
146147
self.fields["officers"].help_text = "Student officers can send club announcements to subscribers."
147-
self.fields["club_sponsors"].help_text = (
148-
"Club sponsors can manage this club's announcements. May be different from the activity's scheduled sponsors."
149-
)
148+
self.fields[
149+
"club_sponsors"
150+
].help_text = "Club sponsors can manage this club's announcements. May be different from the activity's scheduled sponsors."
150151
self.fields["subscribers"].help_text = "Students who subscribe to this activity will receive club announcements."
151152

152153
# These fields are rendered on the right of the page on the edit activity page.
@@ -161,14 +162,12 @@ def __init__(self, *args, **kwargs):
161162
"seniors_allowed",
162163
}
163164

164-
self.club_announcements_fields = set(
165-
[
166-
"subscriptions_enabled",
167-
"club_sponsors",
168-
"officers",
169-
"subscribers",
170-
]
171-
)
165+
self.club_announcements_fields = {
166+
"subscriptions_enabled",
167+
"club_sponsors",
168+
"officers",
169+
"subscribers",
170+
}
172171

173172
class Meta:
174173
model = EighthActivity

intranet/apps/eighth/views/activities.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def settings_view(request, activity_id=None):
7878

7979
def chunks(items, n):
8080
for i in range(0, len(items), n):
81-
yield items[i: i + n]
81+
yield items[i : i + n]
8282

8383

8484
def current_school_year():

intranet/apps/users/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1272,7 +1272,7 @@ def attribute_is_public(self, permission: str) -> bool:
12721272

12731273

12741274
PERMISSIONS_NAMES = {
1275-
prefix: [name[len(prefix) + 1:] for name in dir(UserProperties) if name.startswith(prefix + "_")] for prefix in ["self", "parent"]
1275+
prefix: [name[len(prefix) + 1 :] for name in dir(UserProperties) if name.startswith(prefix + "_")] for prefix in ["self", "parent"]
12761276
}
12771277

12781278

0 commit comments

Comments
 (0)