Commit 7f8d7a6d authored by Ludovic LANGE's avatar Ludovic LANGE Committed by Vincent A

[cesu] Do not download unavailable documents

Some documents are not ready to be downloaded, and when trying to download
them it results in a 500 error.
When now apply the same logic as in the site to decide if a document should
be listed or not.
parent 6a4c244f
Pipeline #3523 passed with stages
in 17 minutes and 10 seconds
......@@ -36,6 +36,7 @@ from weboob.browser.filters.standard import (
Format,
Field,
BrowserURL,
Lower,
)
......@@ -119,6 +120,10 @@ class RegistrationPage(CesuApiPage):
item_xpath = "listeObjets"
class item(ItemElement):
def condition(self):
return Lower(CleanText(Dict('isTelechargeable')))(self.el) == 'true'
klass = Document
obj_id = Format("%s_%s", Env("subscription"), Dict("referenceDocumentaire"))
......
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