plateforme-corres2math/apps/participation/signals.py

11 lines
385 B
Python

from participation.models import Participation, Video
def create_team_participation(instance, **_):
participation = Participation.objects.get_or_create(team=instance)[0]
if not participation.solution:
participation.solution = Video.objects.create()
if not participation.synthesis:
participation.synthesis = Video.objects.create()
participation.save()