diff --git a/app/scodoc/sco_abs.py b/app/scodoc/sco_abs.py index 2ae03ce81..77cc6048d 100644 --- a/app/scodoc/sco_abs.py +++ b/app/scodoc/sco_abs.py @@ -229,8 +229,11 @@ def DateRangeISO(date_beg, date_end, workable=1): date_end = date_beg r = [] work_saturday = is_work_saturday() - cur = ddmmyyyy(date_beg, work_saturday=work_saturday) - end = ddmmyyyy(date_end, work_saturday=work_saturday) + try: + cur = ddmmyyyy(date_beg, work_saturday=work_saturday) + end = ddmmyyyy(date_end, work_saturday=work_saturday) + except (AttributeError, ValueError) as e: + raise ScoValueError("date invalide !") from e while cur <= end: if (not workable) or cur.iswork(): r.append(cur)