summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErnesto Rico-Schmidt <e.rico.schmidt@gmail.com>2011-10-16 12:56:31 (GMT)
committerErnesto Rico-Schmidt <e.rico.schmidt@gmail.com>2011-10-16 12:56:31 (GMT)
commitc4f7faf65485df31299e137fd4e2eb596b1c84be (patch)
treeb7e02c5f70bc73c11669a1a763f4fda6bee036a3
parenta48129a20a177e6f9a81720e83137f682248bfa6 (diff)
fixed save method for ProgramSlot.
-rw-r--r--program/models.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/program/models.py b/program/models.py
index 89bf8f8..eed5ac1 100644
--- a/program/models.py
+++ b/program/models.py
@@ -182,9 +182,9 @@ class ProgramSlot(models.Model):
return u'%s, %s, %s - %s' % (weekday, self.rrule, tstart, tend)
def save(self, *args, **kwargs):
- super(ProgramSlot, self).save(*args, **kwargs)
-
if not self.pk:
+ super(ProgramSlot, self).save(*args, **kwargs)
+
if self.rrule.freq == 0:
byweekday_start = None
byweekday_end = None
@@ -249,8 +249,8 @@ class TimeSlotManager(models.Manager):
new_programslot.save()
except ValidationError:
pass
-
- return new_programslot.timeslots.all()[0]
+ else:
+ return new_programslot.timeslots.all()[0]
def get_day_timeslots(self, day):
today = datetime.combine(day, time(6,0))