1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-02-12 09: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/
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
RUN mkdir /run/nginx

View File

@ -17,7 +17,7 @@ class Command(BaseCommand):
stat_file = os.stat("corres2math/static/logo.png")
with open("corres2math/static/logo.png", "rb") as f:
resp = Matrix.upload(f, filename="logo.png", content_type="image/png",
filesize=stat_file.st_size)[0][0]
filesize=stat_file.st_size)[0][0]
avatar_uri = resp.content_uri
with open(".matrix_avatar", "w") as f:
f.write(avatar_uri)

View File

@ -1,6 +1,7 @@
from django.db.models import Q
from corres2math.lists import get_sympa_client
from django.core.management import BaseCommand
from django.db.models import Q
from participation.models import Team
from registration.models import CoachRegistration, StudentRegistration

View File

@ -65,7 +65,7 @@ class Team(models.Model):
"education",
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, f"probleme-{self.participation.problem}", False,
f"Equipe {self.name}")

View File

@ -2,7 +2,7 @@ from corres2math.lists import get_sympa_client
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.
"""
@ -12,8 +12,6 @@ def create_team_participation(instance, created, **_):
if not participation.synthesis:
participation.synthesis = Video.objects.create()
participation.save()
if not created:
participation.team.create_mailing_list()
def update_mailing_list(instance: Team, **_):

View File

@ -2,13 +2,10 @@
crond -l 0
python manage.py migrate
python manage.py loaddata initial
nginx
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 '-';
else
python manage.py runserver 0.0.0.0:8000;
./manage.py runserver 0.0.0.0:8000;
fi