Skip to content

Commit

Permalink
chore: fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonGrace2282 committed Oct 2, 2024
1 parent e4420ba commit 51c00ac
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 20 deletions.
9 changes: 7 additions & 2 deletions intranet/apps/announcements/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@
from ..groups.models import Group
from .forms import AnnouncementAdminForm, AnnouncementEditForm, AnnouncementForm, AnnouncementRequestForm, ClubAnnouncementForm
from .models import Announcement, AnnouncementRequest
from .notifications import (admin_request_announcement_email, announcement_approved_email, announcement_posted_email, announcement_posted_twitter,
request_announcement_email)
from .notifications import (
admin_request_announcement_email,
announcement_approved_email,
announcement_posted_email,
announcement_posted_twitter,
request_announcement_email,
)

logger = logging.getLogger(__name__)

Expand Down
6 changes: 3 additions & 3 deletions intranet/apps/eighth/forms/activities.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ def __init__(self, *args, **kwargs):
self.fields["subscriptions_enabled"].label = "Enable club announcements"
self.fields["subscriptions_enabled"].help_text = "Allow students to subscribe to receive announcements for this activity through Ion."
self.fields["club_sponsors"].label = "Teacher moderators"
self.fields["club_sponsors"].help_text = (
"Teacher moderators can post and manage this club's announcements. You should include club sponsors here."
)
self.fields[
"club_sponsors"
].help_text = "Teacher moderators can post and manage this club's announcements. You should include club sponsors here."
self.fields["officers"].label = "Student officers"
self.fields["officers"].help_text = "Student officers can send club announcements to subscribers."

Expand Down
25 changes: 12 additions & 13 deletions intranet/apps/eighth/forms/admin/activities.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import logging
from typing import List # noqa

from django import forms, http
from django.contrib.auth import get_user_model
Expand All @@ -11,7 +12,7 @@


class ActivityDisplayField(forms.ModelChoiceField):
cancelled_acts = None # type: List[EighthActivity]
cancelled_acts: list[EighthActivity] | None = None

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

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

self.club_announcements_fields = set(
[
"subscriptions_enabled",
"club_sponsors",
"officers",
"subscribers",
]
)
self.club_announcements_fields = {
"subscriptions_enabled",
"club_sponsors",
"officers",
"subscribers",
}

class Meta:
model = EighthActivity
Expand Down
2 changes: 1 addition & 1 deletion intranet/apps/eighth/views/activities.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def settings_view(request, activity_id=None):

def chunks(items, n):
for i in range(0, len(items), n):
yield items[i: i + n]
yield items[i : i + n]


def current_school_year():
Expand Down
2 changes: 1 addition & 1 deletion intranet/apps/users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1272,7 +1272,7 @@ def attribute_is_public(self, permission: str) -> bool:


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


Expand Down

0 comments on commit 51c00ac

Please sign in to comment.