diff options
author | Ernesto Rico-Schmidt <e.rico.schmidt@gmail.com> | 2011-12-29 05:43:02 (GMT) |
---|---|---|
committer | Ernesto Rico-Schmidt <e.rico.schmidt@gmail.com> | 2011-12-29 05:43:02 (GMT) |
commit | dbe965a97a360f9117d5d9ee429fd5229102f2a5 (patch) | |
tree | 9e1fa3cf6b2299868f5ccc2f5cedabcafa38e32e | |
parent | e88b9ffa2cc5e0eda45f86daaaf956a82292f968 (diff) |
fixed brown paper bug in save method.
-rw-r--r-- | program/models.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/program/models.py b/program/models.py index eef98fa..cb52419 100644 --- a/program/models.py +++ b/program/models.py @@ -186,6 +186,8 @@ class ProgramSlot(models.Model): old = ProgramSlot.objects.get(pk=self.pk) if self.rrule != old.rrule or self.byweekday != old.byweekday or self.show != old.show or self.dstart != old.dstart or self.tstart != old.tstart or self.tend != old.tend or self.is_repetition != old.is_repetition: raise ValidationError(u"only until can be changed") + else: + old = False super(ProgramSlot, self).save(*args, **kwargs) @@ -224,7 +226,7 @@ class ProgramSlot(models.Model): bysetpos=self.rrule.bysetpos, byweekday=byweekday_end)) - if not self.pk: + if not old: for k in range(len(starts)): timeslot = TimeSlot.objects.create(programslot=self, start=starts[k], end=ends[k]) elif self.until > old.until: |