Customise mandatory bulletin groups
This commit is contained in:
parent
229b193b25
commit
4eec729dc2
@ -27,7 +27,7 @@ ALLOWED_HOSTS = []
|
||||
|
||||
PROMO_LOGO_URL = 'https://placehold.it/2000x500'
|
||||
PROMO_LOGO_LINK = 'https://example.com'
|
||||
|
||||
PROMO_GROUPS_MANDATORY = ['All Years']
|
||||
|
||||
# Application definition
|
||||
|
||||
|
@ -62,7 +62,7 @@
|
||||
<h2 class="text-center">{{ group.name }}</h2>
|
||||
{% if group.group.subscribable %}
|
||||
<div class="group-options"><a href="https://{{ settings.ALLOWED_HOSTS[0] }}{{ url('membership') }}">Unsubscribe</a></div>
|
||||
{% elif group.name != 'All Years' %}
|
||||
{% elif group.name not in settings.PROMO_GROUPS_MANDATORY %}
|
||||
<div class="group-options"><a href="https://{{ settings.ALLOWED_HOSTS[0] }}{{ url('membership') }}">Change year level</a></div>
|
||||
{% endif %}
|
||||
</th>
|
||||
|
@ -50,7 +50,7 @@ class Group(models.Model):
|
||||
if self.subscribable:
|
||||
return GroupSubscription.objects.filter(member=member, group=self).count() > 0
|
||||
|
||||
if self.name == 'All Years':
|
||||
if self.name in settings.PROMO_GROUPS_MANDATORY:
|
||||
return True
|
||||
if next(v for k, v in Member.YEARS if k == member.year) in self.name.split('/'):
|
||||
# Year level group
|
||||
|
Loading…
Reference in New Issue
Block a user