catch error parsing syndicate-to response

This commit is contained in:
Kyle Mahan 2016-08-20 09:01:25 -07:00
parent 4a2d4ad50d
commit 40942f9955

View file

@ -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')