The new woob repository is here: https://gitlab.com/woob/woob. This gitlab will be removed soon.

Commit a5d0c13e authored by thibault douge's avatar thibault douge Committed by Vincent A

[orange] return empty list of invoices if the user is not the account holder

parent 0ed6abb9
......@@ -299,6 +299,14 @@ def iter_documents(self, subscription):
return []
raise
except ClientError as e:
if e.response.status_code == 412:
# if the code is 412 the user is not the owner of the subscription and we can't get the invoices
msg = e.response.json()['error']['customerMessage']['subMessage']
self.logger.info("no documents because: %s", msg)
return []
raise
for b in self.page.get_bills(subid=subscription.id):
documents.append(b)
return iter(documents)
......@@ -327,5 +335,5 @@ def download_document(self, document):
except ClientError as e:
if e.response.status_code == 422:
# if the code is 422 the download of the document is currently unavailable
return NotAvailable
raise
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