1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-02-12 15:41:18 +00:00

Compare commits

..

No commits in common. "0fe1f9c34857f909b88194493dffbf3af67b14f5" and "10932d1cc50809c4646498b378401267c40cf4dd" have entirely different histories.

6 changed files with 9 additions and 11 deletions

View File

@ -16,7 +16,9 @@ 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

View File

@ -1,6 +1,7 @@
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

View File

@ -65,7 +65,7 @@ class Team(models.Model):
"education", "education",
raise_error=False, raise_error=False,
) )
if self.pk and self.participation.valid: if 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}")

View File

@ -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, created, **_): def create_team_participation(instance, **_):
""" """
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,8 +12,6 @@ def create_team_participation(instance, created, **_):
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, **_):

View File

@ -2,13 +2,10 @@
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
python manage.py runserver 0.0.0.0:8000; ./manage.py runserver 0.0.0.0:8000;
fi fi