diff --git a/ssmembership/jinja2/ssmembership/renew/review.html b/ssmembership/jinja2/ssmembership/renew/review.html
index ecdd011..1248170 100644
--- a/ssmembership/jinja2/ssmembership/renew/review.html
+++ b/ssmembership/jinja2/ssmembership/renew/review.html
@@ -2,7 +2,7 @@
{#
Society Self-Service
- Copyright © 2018-2020 Yingtong Li (RunasSudo)
+ Copyright © 2018-2022 Yingtong Li (RunasSudo)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
@@ -79,32 +79,34 @@
-
- MUMUS Mail
-
-
-
-
-
-
-
-
- {% for group in import('sspromotions.models').Group.objects.all() %}
- {% if group.subscribable %}
-
-
-
-
-
-
- {% endif %}
- {% endfor %}
-
MUMUS Mail is personalised for you. Choose the groups that you would like to see first in each edition of MUMUS Mail.
+ {% if 'sspromotions' in settings.INSTALLED_APPS %}
+
+
MUMUS Mail
+
+
+
+
-
+
+
+
+ {% for group in import('sspromotions.models').Group.objects.all() %}
+ {% if group.subscribable %}
+
+
+
+
+
+
+ {% endif %}
+ {% endfor %}
+
MUMUS Mail is personalised for you. Choose the groups that you would like to see first in each edition of MUMUS Mail.
+
+
+ {% endif %}
diff --git a/ssmembership/jinja2/ssmembership/signup/index.html b/ssmembership/jinja2/ssmembership/signup/index.html
index 09701e7..969a630 100644
--- a/ssmembership/jinja2/ssmembership/signup/index.html
+++ b/ssmembership/jinja2/ssmembership/signup/index.html
@@ -2,7 +2,7 @@
{#
Society Self-Service
- Copyright © 2018-2019 Yingtong Li (RunasSudo)
+ Copyright © 2018-2022 Yingtong Li (RunasSudo)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
@@ -72,32 +72,34 @@
-
- MUMUS Mail
-
-
-
-
-
-
-
-
- {% for group in import('sspromotions.models').Group.objects.all() %}
- {% if group.subscribable %}
-
-
-
-
-
-
- {% endif %}
- {% endfor %}
-
MUMUS Mail is personalised for you. Choose the groups that you would like to see first in each edition of MUMUS Mail.
+ {% if 'sspromotions' in settings.INSTALLED_APPS %}
+
+
MUMUS Mail
+
+
+
+
-
+
+
+
+ {% for group in import('sspromotions.models').Group.objects.all() %}
+ {% if group.subscribable %}
+
+
+
+
+
+
+ {% endif %}
+ {% endfor %}
+
MUMUS Mail is personalised for you. Choose the groups that you would like to see first in each edition of MUMUS Mail.
+
+
+ {% endif %}
diff --git a/ssmembership/views.py b/ssmembership/views.py
index 8924ad5..5b60ee3 100644
--- a/ssmembership/views.py
+++ b/ssmembership/views.py
@@ -1,5 +1,5 @@
# Society Self-Service
-# Copyright © 2018-2020 Yingtong Li (RunasSudo)
+# Copyright © 2018-2022 Yingtong Li (RunasSudo)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@@ -157,13 +157,14 @@ def renew_save(request):
member.save()
# Update bulletin
- import sspromotions.models
- sspromotions.models.BulletinSubscription.set_member_subscribed(member, True if request.POST['bulletin_subscribe'] == '1' else False)
- for group in sspromotions.models.Group.objects.filter(subscribable=True).all():
- if ('bulletin_group_' + str(group.id)) in request.POST and request.POST['bulletin_group_' + str(group.id)]:
- group.subscribe_member(member, True)
- else:
- group.subscribe_member(member, False)
+ if 'sspromotions' in settings.INSTALLED_APPS:
+ import sspromotions.models
+ sspromotions.models.BulletinSubscription.set_member_subscribed(member, True if request.POST['bulletin_subscribe'] == '1' else False)
+ for group in sspromotions.models.Group.objects.filter(subscribable=True).all():
+ if ('bulletin_group_' + str(group.id)) in request.POST and request.POST['bulletin_group_' + str(group.id)]:
+ group.subscribe_member(member, True)
+ else:
+ group.subscribe_member(member, False)
return render(request, 'ssmembership/renew/complete.html')
@@ -209,12 +210,13 @@ def signup_save(request):
member.save()
# Update bulletin
- import sspromotions.models
- sspromotions.models.BulletinSubscription.set_member_subscribed(member, True if request.POST['bulletin_subscribe'] == '1' else False)
- for group in sspromotions.models.Group.objects.filter(subscribable=True).all():
- if ('bulletin_group_' + str(group.id)) in request.POST and request.POST['bulletin_group_' + str(group.id)]:
- group.subscribe_member(member, True)
- else:
- group.subscribe_member(member, False)
+ if 'sspromotions' in settings.INSTALLED_APPS:
+ import sspromotions.models
+ sspromotions.models.BulletinSubscription.set_member_subscribed(member, True if request.POST['bulletin_subscribe'] == '1' else False)
+ for group in sspromotions.models.Group.objects.filter(subscribable=True).all():
+ if ('bulletin_group_' + str(group.id)) in request.POST and request.POST['bulletin_group_' + str(group.id)]:
+ group.subscribe_member(member, True)
+ else:
+ group.subscribe_member(member, False)
return render(request, 'ssmembership/signup/complete.html')