accept http 410 on server call
This commit is contained in:
parent
9f74b8fbf7
commit
4a2135512f
1 changed files with 9 additions and 11 deletions
|
@ -313,19 +313,17 @@ class OnlineSource(ModelSQL, ModelView):
|
|||
""" generate url
|
||||
"""
|
||||
if self.fixed_url is True:
|
||||
if url is None:
|
||||
if not url:
|
||||
raise UserError(gettext(
|
||||
'investment.msg_missing_url',
|
||||
oname=self.rec_name,
|
||||
))
|
||||
oname=self.rec_name))
|
||||
return url
|
||||
else:
|
||||
if self.url:
|
||||
return Template(self.url).substitute({
|
||||
'isin': isin if isin is not None else '',
|
||||
'nsin': nsin if nsin is not None else '',
|
||||
'symbol': symbol if symbol is not None else '',
|
||||
})
|
||||
|
||||
if self.url:
|
||||
return Template(self.url).substitute({
|
||||
'isin': isin if isin is not None else '',
|
||||
'nsin': nsin if nsin is not None else '',
|
||||
'symbol': symbol if symbol is not None else ''})
|
||||
|
||||
@classmethod
|
||||
def update_rate(cls, asset):
|
||||
|
@ -455,7 +453,7 @@ class OnlineSource(ModelSQL, ModelView):
|
|||
'msg': res1.reason,
|
||||
}
|
||||
|
||||
if res1.status_code in [200, 204]:
|
||||
if res1.status_code in [200, 204, 410]:
|
||||
html = res1.text
|
||||
|
||||
# remove html-tags
|
||||
|
|
Loading…
Reference in a new issue