Skip to content
Snippets Groups Projects
Verified Commit 91f9f0c8 authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

feat: update signal to create notes with contributors, language & topic

parent 9f0605b4
No related branches found
No related tags found
No related merge requests found
......@@ -6,4 +6,12 @@ from program.models import Note, TimeSlot
@receiver(post_save, sender=TimeSlot)
def attach_note(sender, instance, created, **kwargs):
if created:
Note.objects.create(timeslot=instance)
note = Note.objects.create(timeslot=instance)
show = instance.schedule.show
note.contributors.set(show.hosts.values_list("id", flat=True))
note.language.set(show.language.values_list("id", flat=True))
note.topic.set(show.topic.values_list("id", flat=True))
note.save()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment