Commit 2c0b3517 by François C.

Merge branch 'dev_cooperatic' into 'dev_principale'

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

See merge request !5
parents 6d61deab 4c3c6fbb
......@@ -578,6 +578,8 @@ class ShiftTemplate(models.Model):
before = fields.Datetime.to_string(
datetime.today() + timedelta(days=SHIFT_CREATION_DAYS))
for template in self:
if len(str(template.rrule).strip()) == 0:
continue # It's not a recurring template
after = template.last_shift_date
rec_dates = template.get_recurrent_dates(
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