From 5ddb918529290a89dada6c931de3b31c99a13c52 Mon Sep 17 00:00:00 2001
From: Ernesto Rico Schmidt <ernesto@helsinki.at>
Date: Sun, 22 Nov 2020 22:46:46 -0400
Subject: [PATCH] Fix #50

---
 program/models.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/program/models.py b/program/models.py
index 322d796b..45755948 100644
--- a/program/models.py
+++ b/program/models.py
@@ -467,11 +467,11 @@ class Schedule(models.Model):
         rrule = RRule.objects.get(pk=int(sdl['rrule']))
         show = Show.objects.get(pk=int(show_pk))
 
-        is_repetition = True if 'is_repetition' in sdl and sdl['is_repetition'] == 'true' else False
+        is_repetition = True if 'is_repetition' in sdl and sdl['is_repetition'] is True else False
         fallback_id = int(sdl['fallback_id']) if sdl['fallback_id'] else None
         automation_id = int(sdl['automation_id']) if sdl['automation_id'] else None
         add_days_no = int(sdl['add_days_no']) if sdl['add_days_no'] > 0 else None
-        add_business_days_only = True if sdl['add_business_days_only'] == 'true' else False
+        add_business_days_only = True if 'add_business_days_only' in sdl and sdl['add_business_days_only'] is True else False
 
         dstart = datetime.strptime(str(sdl['dstart']), '%Y-%m-%d').date()
 
@@ -1182,7 +1182,7 @@ class TimeSlot(models.Model):
     def __str__(self):
         start = self.start.strftime('%a, %d.%m.%Y %H:%M')
         end = self.end.strftime('%H:%M')
-        is_repetition = ' ' + _('(REP)') if self.schedule.is_repetition == 1 else ''
+        is_repetition = ' ' + _('(REP)') if self.schedule.is_repetition is True else ''
 
         return '%s - %s  %s (%s)' % (start, end, is_repetition, self.show.name)
 
-- 
GitLab