mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-02-12 12:21:18 +00:00
Compare commits
No commits in common. "0fe1f9c34857f909b88194493dffbf3af67b14f5" and "10932d1cc50809c4646498b378401267c40cf4dd" have entirely different histories.
0fe1f9c348
...
10932d1cc5
@ -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
|
||||||
|
@ -17,7 +17,7 @@ class Command(BaseCommand):
|
|||||||
stat_file = os.stat("corres2math/static/logo.png")
|
stat_file = os.stat("corres2math/static/logo.png")
|
||||||
with open("corres2math/static/logo.png", "rb") as f:
|
with open("corres2math/static/logo.png", "rb") as f:
|
||||||
resp = Matrix.upload(f, filename="logo.png", content_type="image/png",
|
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
|
avatar_uri = resp.content_uri
|
||||||
with open(".matrix_avatar", "w") as f:
|
with open(".matrix_avatar", "w") as f:
|
||||||
f.write(avatar_uri)
|
f.write(avatar_uri)
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -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}")
|
||||||
|
@ -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, **_):
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user