Commit dda53851 authored by Jérome Perrin's avatar Jérome Perrin

raise an error when building a sequence without specifying period duration (it

was causing an infinite loop)


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23061 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c2d160bd
...@@ -2494,8 +2494,11 @@ class Sequence: ...@@ -2494,8 +2494,11 @@ class Sequence:
second, minute, second, minute,
hour, day, hour, day,
month, year - duration of each time period (cumulative) month, year - duration of each time period (cumulative)
at least one of those parameters must be specified.
""" """
if not (second or minute or hour or day or month or year):
raise ValueError('Period duration must be specified')
self.item_list = [] self.item_list = []
# Calculate all time period # Calculate all time period
current_from_date = from_date current_from_date = from_date
......
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