aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/plugins/openid
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2014-06-02 20:59:28 +0300
committerBerker Peksag <berker.peksag@gmail.com>2014-06-02 20:59:28 +0300
commite49b7e02b2150413d2e78db709277fae0887be46 (patch)
tree6c39946f2b4aca080c75274f97ec263f793ae012 /mediagoblin/plugins/openid
parenta80c74bbcc6ac0208cfef725a441810a29876cff (diff)
downloadmediagoblin-e49b7e02b2150413d2e78db709277fae0887be46.tar.lz
mediagoblin-e49b7e02b2150413d2e78db709277fae0887be46.tar.xz
mediagoblin-e49b7e02b2150413d2e78db709277fae0887be46.zip
Use six.text_type instead of unicode().
I will be switch to use ``from __future__ import unicode_literals`` later.
Diffstat (limited to 'mediagoblin/plugins/openid')
-rw-r--r--mediagoblin/plugins/openid/store.py6
-rw-r--r--mediagoblin/plugins/openid/views.py5
2 files changed, 8 insertions, 3 deletions
diff --git a/mediagoblin/plugins/openid/store.py b/mediagoblin/plugins/openid/store.py
index 8f9a7012..24726814 100644
--- a/mediagoblin/plugins/openid/store.py
+++ b/mediagoblin/plugins/openid/store.py
@@ -16,6 +16,8 @@
import base64
import time
+import six
+
from openid.association import Association as OIDAssociation
from openid.store.interface import OpenIDStore
from openid.store import nonce
@@ -34,12 +36,12 @@ class SQLAlchemyOpenIDStore(OpenIDStore):
if not assoc:
assoc = Association()
- assoc.server_url = unicode(server_url)
+ assoc.server_url = six.text_type(server_url)
assoc.handle = association.handle
# django uses base64 encoding, python-openid uses a blob field for
# secret
- assoc.secret = unicode(base64.encodestring(association.secret))
+ assoc.secret = six.text_type(base64.encodestring(association.secret))
assoc.issued = association.issued
assoc.lifetime = association.lifetime
assoc.assoc_type = association.assoc_type
diff --git a/mediagoblin/plugins/openid/views.py b/mediagoblin/plugins/openid/views.py
index bb2de7ab..71f444fa 100644
--- a/mediagoblin/plugins/openid/views.py
+++ b/mediagoblin/plugins/openid/views.py
@@ -13,6 +13,9 @@
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+import six
+
from openid.consumer import consumer
from openid.consumer.discover import DiscoveryFailure
from openid.extensions.sreg import SRegRequest, SRegResponse
@@ -186,7 +189,7 @@ def finish_login(request):
if user:
# Set up login in session
- request.session['user_id'] = unicode(user.id)
+ request.session['user_id'] = six.text_type(user.id)
request.session.save()
if request.session.get('next'):