Skip to content
Snippets Groups Projects
Commit 70bcc8c6 authored by Auriane Strasser's avatar Auriane Strasser
Browse files

Merge branch 'master' into dev

parents e096a4ef fb851646
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,12 @@ from aws.conf import *
from .common import *
DEBUG = os.environ.get('DEBUG', False)
# NOTE: `or False` ensures the value is `False` (the boolean)
# if the value given in environment is false-y (e.g. empty string)
# Otherwise may lead to unexpected bugs.
# For example, SendGrid could send an empty string as the sandbox mode,
# leading to strange 400 Bad Request errors.
DEBUG = os.environ.get('DEBUG', False) or False
ALLOWED_HOSTS = [
'localhost',
......
......@@ -17,7 +17,7 @@ class RegistrationsOpenFilter(admin.SimpleListFilter):
https://docs.djangoproject.com/fr/2.0/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_filter
"""
title = "état des inscriptions"
title = 'état des inscriptions'
parameter_name = 'registrations_open'
def lookups(self, request, model_admin):
......@@ -48,18 +48,22 @@ class VisitForm(forms.ModelForm):
- Deadline must be before the date
- End time must be after start time
Keep in mind that values may be `None` if not provided in the form.
"""
cleaned_data = super().clean()
date = cleaned_data.get('date')
deadline = cleaned_data.get('deadline')
start_time = cleaned_data.get('start_time')
end_time = cleaned_data.get('end_time')
if deadline is not None:
if deadline.date() >= date:
error = forms.ValidationError(
"La date limite d'inscription doit être avant la "
"date de la sortie."
)
self.add_error('deadline', error)
if end_time is not None and start_time is not None:
if end_time <= start_time:
error = forms.ValidationError(
"L'heure de fin doit être après l'heure de début.")
......
......@@ -216,7 +216,7 @@ class Visit(models.Model):
def get_site_url(self):
site = Site.objects.get_current()
return f'https://{site.domain}/visits/{self.pk}'
return f'https://{site.domain}/membres/sorties/{self.pk}'
def __str__(self):
return str(self.title)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment