bugfix: list is not an iterator msg when processing errors

This commit is contained in:
Kyle Mahan 2015-02-02 08:42:38 -08:00
parent 1da9d95fc6
commit 32fb204a9c
2 changed files with 5 additions and 3 deletions

View File

@ -136,11 +136,13 @@ class MicropubClient:
rdata = parse_qs(response.text) rdata = parse_qs(response.text)
if response.status_code != 200: if response.status_code != 200:
error_vals = rdata.get('error')
error_descs = rdata.get('error_description')
return AuthResponse( return AuthResponse(
next_url=next_url, next_url=next_url,
error='authorization failed. {}: {}'.format( error='authorization failed. {}: {}'.format(
next(rdata.get('error', []), None), error_vals[0] if error_vals else 'Unknown Error',
next(rdata.get('error_description', []), None))) error_descs[0] if error_descs else 'Unknown Error'))
if 'me' not in rdata: if 'me' not in rdata:
return AuthResponse( return AuthResponse(

View File

@ -11,7 +11,7 @@ from setuptools import setup
setup( setup(
name='Flask-Micropub', name='Flask-Micropub',
version='0.1.2', version='0.1.3',
url='https://github.com/kylewm/flask-micropub/', url='https://github.com/kylewm/flask-micropub/',
license='BSD', license='BSD',
author='Kyle Mahan', author='Kyle Mahan',