catch error parsing syndicate-to response
This commit is contained in:
parent
4a2d4ad50d
commit
40942f9955
1 changed files with 15 additions and 11 deletions
|
@ -366,6 +366,7 @@ def update_micropub_syndicate_to():
|
|||
if content_type:
|
||||
content_type = content_type.split(';', 1)[0]
|
||||
|
||||
try:
|
||||
if content_type == 'application/json':
|
||||
blob = resp.json()
|
||||
syndicate_tos = adapt_expanded(blob.get('syndicate-to-expanded'))
|
||||
|
@ -379,6 +380,9 @@ def update_micropub_syndicate_to():
|
|||
|
||||
flask_login.current_user.set_setting('syndicate-to', syndicate_tos)
|
||||
db.session.commit()
|
||||
except ValueError as e:
|
||||
flask.flash('Could not parse syndicate-to response: {}'.format(e)
|
||||
|
||||
|
||||
|
||||
@views.route('/deauthorize')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue