Skip to content
Snippets Groups Projects
Commit ea733cef authored by florimondmanca's avatar florimondmanca
Browse files

update settings, update participation notification template

parent bd08e784
Branches
No related tags found
No related merge requests found
"""Mails app settings."""
from django.conf import settings
import warnings
NOTIFICATIONS_ADDRESS = getattr(settings, 'MAILS_NOTIFICATIONS_ADDRESS')
ENABLED = getattr(settings, 'MAILS_ENABLED')
SENDGRID_API_KEY = getattr(settings, 'SENDGRID_API_KEY', None)
if SENDGRID_API_KEY is None:
warnings.warn('SENDGRID_API_KEY not set, emails will not be delivered')
......@@ -217,6 +217,9 @@ USE_TZ = True
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'staticfiles'),
]
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
......
......@@ -20,7 +20,7 @@ ALLOWED_HOSTS = [
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
SECURE_BROWSER_XSS_FILTER = True
SECURE_SSL_REDIRECT = True
# SECURE_SSL_REDIRECT = True
# Mails
MAILS_ENABLED = True
......
......@@ -18,7 +18,6 @@ En te rendant sur [l'espace sorties]({{ visit.get_site_url }}), tu peux dès à
{% else %}
Malheureusement, en raison du nombre de places limité, tu ne pourras pas participer à cette sortie. 😔
Nous te recontacterons si des places se libèrent suite à des désistements.
{% endif %}
{% endblock %}
......@@ -27,7 +26,6 @@ Nous te recontacterons si des places se libèrent suite à des désistements.
À bientôt,
Les organisateurs
{% if organizers %}{{ organizers|join:', '}}{% endif %}
Nous contacter : oser.sortie@gmail.fr
{% endblock %}
......@@ -33,13 +33,9 @@ class Participation(Notification):
args = ('user', 'visit',)
accepted: bool
def get_organizers(self):
return self.visit.organizers.values_list('user__first_name', flat=True)
def get_context(self):
context = super().get_context()
context['accepted'] = self.accepted
context['organizers'] = self.get_organizers()
return context
def get_subject(self):
......@@ -50,14 +46,9 @@ class Participation(Notification):
@classmethod
def example(cls):
class Example(cls):
def get_organizers(self):
return ['Julien', 'Louise']
user = User(email='john.doe@example.com', first_name='John')
visit = Visit(title='Visite du Palais de la Découverte', date=now())
return Example(user=user, visit=visit)
return cls(user=user, visit=visit)
class Accepted(Participation):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment