Commit 12040160 by François C.

Fix shifts creation bug if non-recurrent shift_template exist in database

parent f42b52db
...@@ -578,6 +578,8 @@ class ShiftTemplate(models.Model): ...@@ -578,6 +578,8 @@ class ShiftTemplate(models.Model):
before = fields.Datetime.to_string( before = fields.Datetime.to_string(
datetime.today() + timedelta(days=SHIFT_CREATION_DAYS)) datetime.today() + timedelta(days=SHIFT_CREATION_DAYS))
for template in self: for template in self:
if len(str(template.rrule).strip()) == 0:
continue # It's not a recurring template
after = template.last_shift_date after = template.last_shift_date
rec_dates = template.get_recurrent_dates( rec_dates = template.get_recurrent_dates(
after=after, before=before) after=after, before=before)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment