Commit 4c3c6fbb by François C.

Merge branch 'Fix_shifts_creation' into 'dev_cooperatic'

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

See merge request !4
parents f42b52db 12040160
...@@ -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