[PATCH 04 of 16 Mailinglist cube] Do not try to import _ from cubicweb

Nsukami Patrick ptrck at nskm.xyz
Wed Apr 1 09:45:19 CEST 2020


# HG changeset patch
# User Nsukami Patrick <ptrck at nskm dot xyz>
# Date 1585461521 0
#      Sun Mar 29 05:58:41 2020 +0000
# Node ID c58e882f7866cf64a5a572b82de62fc98c882c26
# Parent  e23cb983830cefdb4c758a2f7d4c99221c80e1b9
Do not try to import _ from cubicweb

diff --git a/cubicweb_mailinglist/schema.py b/cubicweb_mailinglist/schema.py
--- a/cubicweb_mailinglist/schema.py
+++ b/cubicweb_mailinglist/schema.py
@@ -1,11 +1,7 @@
 from yams.buildobjs import EntityType, String, RichString
 from yams.reader import context
 
-try:
-    from cubicweb import _
-except ImportError:
-    _ = unicode
-
+from cubicweb import _
 
 class MailingList(EntityType):
     __permissions__ = {
diff --git a/cubicweb_mailinglist/views.py b/cubicweb_mailinglist/views.py
--- a/cubicweb_mailinglist/views.py
+++ b/cubicweb_mailinglist/views.py
@@ -11,10 +11,8 @@
 from cubicweb.web import action
 from cubicweb.web.views import primary, baseviews, uicfg
 
-try:
-    from cubicweb import _
-except ImportError:
-    _ = unicode
+
+from cubicweb import _
 
 
 for attr in ('name', 'homepage', 'archive', 'mlid', 'email_address'):




More information about the cubicweb-devel mailing list