mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-02-12 12:21:18 +00:00
Compare commits
3 Commits
10932d1cc5
...
0fe1f9c348
Author | SHA1 | Date | |
---|---|---|---|
|
0fe1f9c348 | ||
|
9867e5e2a8 | ||
|
48b34e4362 |
@ -16,9 +16,7 @@ RUN pip install -r requirements.txt --no-cache-dir
|
|||||||
COPY . /code/
|
COPY . /code/
|
||||||
|
|
||||||
RUN python manage.py collectstatic --noinput && \
|
RUN python manage.py collectstatic --noinput && \
|
||||||
python manage.py compilemessages && \
|
python manage.py compilemessages
|
||||||
python manage.py migrate && \
|
|
||||||
python manage.py loaddata initial
|
|
||||||
|
|
||||||
# Configure nginx
|
# Configure nginx
|
||||||
RUN mkdir /run/nginx
|
RUN mkdir /run/nginx
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
from django.db.models import Q
|
|
||||||
|
|
||||||
from corres2math.lists import get_sympa_client
|
from corres2math.lists import get_sympa_client
|
||||||
from django.core.management import BaseCommand
|
from django.core.management import BaseCommand
|
||||||
|
from django.db.models import Q
|
||||||
from participation.models import Team
|
from participation.models import Team
|
||||||
from registration.models import CoachRegistration, StudentRegistration
|
from registration.models import CoachRegistration, StudentRegistration
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ class Team(models.Model):
|
|||||||
"education",
|
"education",
|
||||||
raise_error=False,
|
raise_error=False,
|
||||||
)
|
)
|
||||||
if self.participation.valid:
|
if self.pk and self.participation.valid:
|
||||||
get_sympa_client().subscribe(self.email, "equipes", False, f"Equipe {self.name}")
|
get_sympa_client().subscribe(self.email, "equipes", False, f"Equipe {self.name}")
|
||||||
get_sympa_client().subscribe(self.email, f"probleme-{self.participation.problem}", False,
|
get_sympa_client().subscribe(self.email, f"probleme-{self.participation.problem}", False,
|
||||||
f"Equipe {self.name}")
|
f"Equipe {self.name}")
|
||||||
|
@ -2,7 +2,7 @@ from corres2math.lists import get_sympa_client
|
|||||||
from participation.models import Participation, Team, Video
|
from participation.models import Participation, Team, Video
|
||||||
|
|
||||||
|
|
||||||
def create_team_participation(instance, **_):
|
def create_team_participation(instance, created, **_):
|
||||||
"""
|
"""
|
||||||
When a team got created, create an associated team and create Video objects.
|
When a team got created, create an associated team and create Video objects.
|
||||||
"""
|
"""
|
||||||
@ -12,6 +12,8 @@ def create_team_participation(instance, **_):
|
|||||||
if not participation.synthesis:
|
if not participation.synthesis:
|
||||||
participation.synthesis = Video.objects.create()
|
participation.synthesis = Video.objects.create()
|
||||||
participation.save()
|
participation.save()
|
||||||
|
if not created:
|
||||||
|
participation.team.create_mailing_list()
|
||||||
|
|
||||||
|
|
||||||
def update_mailing_list(instance: Team, **_):
|
def update_mailing_list(instance: Team, **_):
|
||||||
|
@ -2,10 +2,13 @@
|
|||||||
|
|
||||||
crond -l 0
|
crond -l 0
|
||||||
|
|
||||||
|
python manage.py migrate
|
||||||
|
python manage.py loaddata initial
|
||||||
|
|
||||||
nginx
|
nginx
|
||||||
|
|
||||||
if [ "$CORRES2MATH_STAGE" = "prod" ]; then
|
if [ "$CORRES2MATH_STAGE" = "prod" ]; then
|
||||||
gunicorn -b 0.0.0.0:8000 --workers=2 --threads=4 --worker-class=gthread corres2math.wsgi --access-logfile '-' --error-logfile '-';
|
gunicorn -b 0.0.0.0:8000 --workers=2 --threads=4 --worker-class=gthread corres2math.wsgi --access-logfile '-' --error-logfile '-';
|
||||||
else
|
else
|
||||||
./manage.py runserver 0.0.0.0:8000;
|
python manage.py runserver 0.0.0.0:8000;
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user