Fix some unicode related issues in oauth and the api.

Found using the previous commit.
This commit is contained in:
Elrond 2012-12-23 23:55:44 +01:00
parent 601e6e0cce
commit 1eac751bd2
2 changed files with 2 additions and 2 deletions

View File

@ -41,7 +41,7 @@ class HTTPAuth(Auth):
return False
user = request.db.User.query.filter_by(
username=request.authorization['username']).first()
username=unicode(request.authorization['username'])).first()
if user.check_login(request.authorization['password']):
request.user = user

View File

@ -101,4 +101,4 @@ class TestAPI(object):
assert response.status_int == 200
assert self.db.MediaEntry.query.filter_by(title='Great JPG!').first()
assert self.db.MediaEntry.query.filter_by(title=u'Great JPG!').first()