Skip to content

Commit 5ff2d9e

Browse files
committed
fix(announcements): allow sponsors to modify announcements
1 parent c7839a6 commit 5ff2d9e

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

intranet/apps/announcements/models.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from ...utils.date import get_date_range_this_year, is_current_year
1212
from ...utils.deletion import set_historical_user
1313
from ...utils.html import nullify_links
14-
from ..eighth.models import EighthActivity
14+
from ..eighth.models import EighthActivity, EighthSponsor
1515

1616

1717
class AnnouncementManager(Manager):
@@ -158,7 +158,12 @@ def can_modify(self, user):
158158
return (
159159
user.is_announcements_admin
160160
or self.is_club_announcement
161-
and (user in self.activity.officers.all() or user in self.activity.sponsors.all() or user in self.activity.club_sponsors.all())
161+
and (
162+
user in self.activity.officers.all()
163+
or user in self.activity.club_sponsors.all()
164+
or EighthSponsor.objects.filter(user=user).exists()
165+
and user.sponsor_obj in self.activity.sponsors.all()
166+
)
162167
)
163168

164169
# False, not None. This can be None if no AnnouncementRequest exists for this Announcement,

intranet/apps/dashboard/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ def dashboard_view(request, show_widgets=True, show_expired=False, show_hidden_c
616616
dashboard_title = dashboard_header = "Club Announcements"
617617
view_announcements_url = "club_announcements"
618618
else:
619-
dashboard_title = dashboard_header = "Announcements"
619+
dashboard_title = dashboard_header = "Dashboard"
620620

621621
num_senior_destinations = len(Senior.objects.filled())
622622

0 commit comments

Comments
 (0)