Skip to content

Commit

Permalink
Merge pull request #37 from yaxu/main
Browse files Browse the repository at this point in the history
Make start/end times unique
  • Loading branch information
munshkr authored Dec 14, 2024
2 parents 71267f2 + fbe01dd commit 67ebaa0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
17 changes: 17 additions & 0 deletions events/migrations/0025_auto_20241214_1133.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 3.1.14 on 2024-12-14 11:33

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('events', '0024_stream_description'),
]

operations = [
migrations.AlterUniqueTogether(
name='stream',
unique_together={('event', 'starts_at'), ('event', 'ends_at')},
),
]
4 changes: 4 additions & 0 deletions events/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ def resolved_test_rtmp_url(self):
if self.event.test_rtmp_url:
tpl = Template(self.event.resolved_test_rtmp_url)
return tpl.safe_substitute(id=self.id, key=self.key)

class Meta:
unique_together = [['event', 'starts_at'], ['event', 'ends_at']]



class StreamNotification(models.Model):
Expand Down

0 comments on commit 67ebaa0

Please sign in to comment.