Commit 3471e3f9 authored by Bez Leputh's avatar Bez Leputh Committed by hydrargyrum
Browse files

[agendadulibre] fix module : No need of strict option in DateTime filter

parent ace5defd
Pipeline #370482694 passed with stages
in 13 minutes and 59 seconds
......@@ -52,7 +52,8 @@ def obj_start_date(self):
'\w* \w* (\d?\d \w* \d{4}) \w* (\d{2}h\d{2}).*',
'\\1 \\2',
flags=re.UNICODE),
parse_func=parse_french_date)(self)
parse_func=parse_french_date,
strict=False)(self)
def obj_end_date(self):
m = re.findall(r'\w* \w* \d?\d \w* \d{4} \w* \d{2}h\d{2}', CleanText('(//p)[1]')(self), re.UNICODE)
......@@ -62,14 +63,16 @@ def obj_end_date(self):
r'\w* \w* (\d?\d \w* \d{4}) \w* \d{2}h\d{2} \w* (\d{2}h\d{2})',
'\\1 \\2',
flags=re.UNICODE),
parse_func=parse_french_date)(self)
parse_func=parse_french_date,
strict=False)(self)
else:
return DateTime(Regexp(CleanText('(//p)[1]'),
r'\w* \w* (\d?\d \w* \d{4}) \w* (\d{2}h\d{2})',
'\\1 \\2',
nth=-1,
flags=re.UNICODE),
parse_func=parse_french_date)(self)
parse_func=parse_french_date,
strict=False)(self)
class EventListPage(HTMLPage):
......@@ -115,7 +118,8 @@ def obj_start_date(self):
'\w* \w* (\d?\d \w* \d{4}) \w* (\d{2}h\d{2}).*',
'\\1 \\2',
flags=re.UNICODE),
parse_func=parse_french_date)(self)
parse_func=parse_french_date,
strict=False)(self)
def obj_end_date(self):
m = re.findall(r'\w* \w* \d?\d \w* \d{4} \w* \d{2}h\d{2}', CleanText('./@title')(self), re.UNICODE)
......@@ -125,14 +129,16 @@ def obj_end_date(self):
r'\w* \w* (\d?\d \w* \d{4}) \w* \d{2}h\d{2} \w* (\d{2}h\d{2})',
'\\1 \\2',
flags=re.UNICODE),
parse_func=parse_french_date)(self)
parse_func=parse_french_date,
strict=False)(self)
else:
return DateTime(Regexp(CleanText('./@title'),
r'\w* \w* (\d?\d \w* \d{4}) \w* (\d{2}h\d{2})',
'\\1 \\2',
nth=-1,
flags=re.UNICODE),
parse_func=parse_french_date)(self)
parse_func=parse_french_date,
strict=False)(self)
def validate(self, obj):
return (self.is_valid_event(obj, self.env['city'], self.env['categories']) and
......
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