Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
oser-backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hamza Touizrat
oser-backend
Commits
70bcc8c6
Commit
70bcc8c6
authored
Nov 10, 2018
by
Auriane Strasser
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' into dev
parents
e096a4ef
fb851646
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
oser_backend/settings/production.py
+6
-1
6 additions, 1 deletion
oser_backend/settings/production.py
visits/admin.py
+16
-12
16 additions, 12 deletions
visits/admin.py
visits/models.py
+1
-1
1 addition, 1 deletion
visits/models.py
with
23 additions
and
14 deletions
oser_backend/settings/production.py
+
6
−
1
View file @
70bcc8c6
...
@@ -6,7 +6,12 @@ from aws.conf import *
...
@@ -6,7 +6,12 @@ from aws.conf import *
from
.common
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
=
[
ALLOWED_HOSTS
=
[
'
localhost
'
,
'
localhost
'
,
...
...
This diff is collapsed.
Click to expand it.
visits/admin.py
+
16
−
12
View file @
70bcc8c6
...
@@ -17,7 +17,7 @@ class RegistrationsOpenFilter(admin.SimpleListFilter):
...
@@ -17,7 +17,7 @@ class RegistrationsOpenFilter(admin.SimpleListFilter):
https://docs.djangoproject.com/fr/2.0/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_filter
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
'
parameter_name
=
'
registrations_open
'
def
lookups
(
self
,
request
,
model_admin
):
def
lookups
(
self
,
request
,
model_admin
):
...
@@ -48,18 +48,22 @@ class VisitForm(forms.ModelForm):
...
@@ -48,18 +48,22 @@ class VisitForm(forms.ModelForm):
- Deadline must be before the date
- Deadline must be before the date
- End time must be after start time
- 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
()
cleaned_data
=
super
().
clean
()
date
=
cleaned_data
.
get
(
'
date
'
)
date
=
cleaned_data
.
get
(
'
date
'
)
deadline
=
cleaned_data
.
get
(
'
deadline
'
)
deadline
=
cleaned_data
.
get
(
'
deadline
'
)
start_time
=
cleaned_data
.
get
(
'
start_time
'
)
start_time
=
cleaned_data
.
get
(
'
start_time
'
)
end_time
=
cleaned_data
.
get
(
'
end_time
'
)
end_time
=
cleaned_data
.
get
(
'
end_time
'
)
if
deadline
is
not
None
:
if
deadline
.
date
()
>=
date
:
if
deadline
.
date
()
>=
date
:
error
=
forms
.
ValidationError
(
error
=
forms
.
ValidationError
(
"
La date limite d
'
inscription doit être avant la
"
"
La date limite d
'
inscription doit être avant la
"
"
date de la sortie.
"
"
date de la sortie.
"
)
)
self
.
add_error
(
'
deadline
'
,
error
)
self
.
add_error
(
'
deadline
'
,
error
)
if
end_time
is
not
None
and
start_time
is
not
None
:
if
end_time
<=
start_time
:
if
end_time
<=
start_time
:
error
=
forms
.
ValidationError
(
error
=
forms
.
ValidationError
(
"
L
'
heure de fin doit être après l
'
heure de début.
"
)
"
L
'
heure de fin doit être après l
'
heure de début.
"
)
...
...
This diff is collapsed.
Click to expand it.
visits/models.py
+
1
−
1
View file @
70bcc8c6
...
@@ -216,7 +216,7 @@ class Visit(models.Model):
...
@@ -216,7 +216,7 @@ class Visit(models.Model):
def
get_site_url
(
self
):
def
get_site_url
(
self
):
site
=
Site
.
objects
.
get_current
()
site
=
Site
.
objects
.
get_current
()
return
f
'
https://
{
site
.
domain
}
/
visit
s/
{
self
.
pk
}
'
return
f
'
https://
{
site
.
domain
}
/
membres/sortie
s/
{
self
.
pk
}
'
def
__str__
(
self
):
def
__str__
(
self
):
return
str
(
self
.
title
)
return
str
(
self
.
title
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment