diff options
author | Ben Sturmfels <ben@sturm.com.au> | 2021-03-05 23:12:19 +1100 |
---|---|---|
committer | Ben Sturmfels <ben@sturm.com.au> | 2021-03-05 23:12:19 +1100 |
commit | dec47c7102cf0aa3a4debf002928db8e460c0d71 (patch) | |
tree | 47631fc15c7af172aa699506adf3d76d3a71976c /mediagoblin/plugins/openid | |
parent | 5f3a782fef4855e10b7259624a14d8afb0f7be93 (diff) | |
download | mediagoblin-dec47c7102cf0aa3a4debf002928db8e460c0d71.tar.lz mediagoblin-dec47c7102cf0aa3a4debf002928db8e460c0d71.tar.xz mediagoblin-dec47c7102cf0aa3a4debf002928db8e460c0d71.zip |
Apply `pyupgrade --py3-plus` to remove Python 2 compatibility code.
Diffstat (limited to 'mediagoblin/plugins/openid')
-rw-r--r-- | mediagoblin/plugins/openid/models.py | 4 | ||||
-rw-r--r-- | mediagoblin/plugins/openid/store.py | 4 | ||||
-rw-r--r-- | mediagoblin/plugins/openid/views.py | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/mediagoblin/plugins/openid/models.py b/mediagoblin/plugins/openid/models.py index 6773f0ad..e51b401c 100644 --- a/mediagoblin/plugins/openid/models.py +++ b/mediagoblin/plugins/openid/models.py @@ -41,7 +41,7 @@ class Nonce(Base): salt = Column(Unicode, primary_key=True) def __unicode__(self): - return u'Nonce: %r, %r' % (self.server_url, self.salt) + return 'Nonce: {!r}, {!r}'.format(self.server_url, self.salt) class Association(Base): @@ -55,7 +55,7 @@ class Association(Base): assoc_type = Column(Unicode) def __unicode__(self): - return u'Association: %r, %r' % (self.server_url, self.handle) + return 'Association: {!r}, {!r}'.format(self.server_url, self.handle) MODELS = [ diff --git a/mediagoblin/plugins/openid/store.py b/mediagoblin/plugins/openid/store.py index 24726814..dd794786 100644 --- a/mediagoblin/plugins/openid/store.py +++ b/mediagoblin/plugins/openid/store.py @@ -36,12 +36,12 @@ class SQLAlchemyOpenIDStore(OpenIDStore): if not assoc: assoc = Association() - assoc.server_url = six.text_type(server_url) + assoc.server_url = str(server_url) assoc.handle = association.handle # django uses base64 encoding, python-openid uses a blob field for # secret - assoc.secret = six.text_type(base64.encodestring(association.secret)) + assoc.secret = str(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 71f444fa..03dee7d4 100644 --- a/mediagoblin/plugins/openid/views.py +++ b/mediagoblin/plugins/openid/views.py @@ -189,7 +189,7 @@ def finish_login(request): if user: # Set up login in session - request.session['user_id'] = six.text_type(user.id) + request.session['user_id'] = str(user.id) request.session.save() if request.session.get('next'): |