convert list of auth_codes to single value
The auth tests use parse_qs() which always returns a list for a name. The MySQL driver apparently converts the list to a single string, but the sqlite3 driver does not so do it ourselves in authorization_code_get() before accessing the database. Change-Id: Ib68a7b2c8c51b8762b595e31c4d6d2878d116b91 Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
parent
ccce5ef454
commit
9249e0a095
@ -20,6 +20,10 @@ from storyboard.db import models
|
||||
def authorization_code_get(code):
|
||||
query = api_base.model_query(models.AuthorizationCode,
|
||||
api_base.get_session())
|
||||
# The query string parser always gives a list, but the database
|
||||
# wants a single value.
|
||||
if isinstance(code, list):
|
||||
code = code[0]
|
||||
return query.filter_by(code=code).first()
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user