From: Elrond Date: Sun, 23 Dec 2012 22:55:44 +0000 (+0100) Subject: Fix some unicode related issues in oauth and the api. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=1eac751bd2b3ecf4f9bfffe101c3f16f1e49eba6;p=mediagoblin.git Fix some unicode related issues in oauth and the api. Found using the previous commit. --- diff --git a/mediagoblin/plugins/httpapiauth/__init__.py b/mediagoblin/plugins/httpapiauth/__init__.py index d3d2065e..081b590e 100644 --- a/mediagoblin/plugins/httpapiauth/__init__.py +++ b/mediagoblin/plugins/httpapiauth/__init__.py @@ -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 diff --git a/mediagoblin/tests/test_api.py b/mediagoblin/tests/test_api.py index de61c681..188cdadb 100644 --- a/mediagoblin/tests/test_api.py +++ b/mediagoblin/tests/test_api.py @@ -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()