[PATCH 4 of 6 rememberme] [py3] Use six.text_type instead of unicode

Denis Laxalde denis.laxalde at logilab.fr
Mon Jun 4 12:06:57 CEST 2018


# HG changeset patch
# User Denis Laxalde <denis.laxalde at logilab.fr>
# Date 1528105057 -7200
#      Mon Jun 04 11:37:37 2018 +0200
# Node ID 0cf1f1c1a3ef1d352623fb1c7bf3b2fb71311946
# Parent  ec12805b454600f7204725ab4fbb8b2416ea66ab
# Available At http://hg.logilab.org/review/cubes/rememberme
#              hg pull http://hg.logilab.org/review/cubes/rememberme -r 0cf1f1c1a3ef
# EXP-Topic py3
[py3] Use six.text_type instead of unicode

diff --git a/views.py b/views.py
--- a/views.py
+++ b/views.py
@@ -7,6 +7,8 @@
 """
 from datetime import date, timedelta
 
+from six import text_type
+
 from cubicweb import Unauthorized, _
 from cubicweb.utils import make_uid
 from cubicweb.predicates import is_instance
@@ -69,7 +71,7 @@ class AuthCookieRetriever(authentication
         #  req has no session set yet
         with session.new_cnx() as cnx:
             authentity = cls.cw_instantiate(cnx.execute,
-                                            magic=unicode(make_uid()),
+                                            magic=text_type(make_uid()),
                                             lifetime=self.cookie_lifetime,
                                             auth_cookie_for_user=user.eid)
             cnx.commit()


More information about the cubicweb-devel mailing list