[biplan] detect invalid events
This commit is contained in:
parent
5945d5d539
commit
77d5e6b0f4
2 changed files with 3 additions and 3 deletions
|
|
@ -54,13 +54,13 @@ class BiplanModule(Module, CapCalendarEvent):
|
|||
query.categories)
|
||||
|
||||
items = list(itertools.chain(concert_events, theatre_events))
|
||||
items.sort(key=lambda o:o.start_date)
|
||||
items.sort(key=lambda o: o.start_date)
|
||||
return items
|
||||
|
||||
def list_events(self, date_from, date_to=None):
|
||||
items = list(itertools.chain(self.browser.list_events_concert(date_from, date_to),
|
||||
self.browser.list_events_theatre(date_from, date_to)))
|
||||
items.sort(key=lambda o:o.start_date)
|
||||
items.sort(key=lambda o: o.start_date)
|
||||
return items
|
||||
|
||||
def get_event(self, _id):
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ class ProgramPage(HTMLPage):
|
|||
return BiplanCalendarEventConcert() if self.env['is_concert'] else BiplanCalendarEventTheatre()
|
||||
|
||||
def condition(self):
|
||||
return (self.el.xpath('./div'))
|
||||
return (self.el.xpath('./div') and CleanText('./div/a/img/@src')(self)[-1] != '/')
|
||||
|
||||
def validate(self, obj):
|
||||
return (self.is_valid_event(obj, self.env['city'], self.env['categories']) and
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue