diff pages/association/membership/page_meta.py @ 6:9ce41ef66dfa

python 3 port
author Goffi <goffi@goffi.org>
date Sat, 05 Oct 2019 01:26:51 +0200
parents 09d66acc7c73
children 67487063f421
line wrap: on
line diff
--- a/pages/association/membership/page_meta.py	Fri Jun 28 17:44:55 2019 +0200
+++ b/pages/association/membership/page_meta.py	Sat Oct 05 01:26:51 2019 +0200
@@ -12,8 +12,8 @@
 
 log = getLogger(__name__)
 
-name = u"association_membership"
-template = u"association/membership.html"
+name = "association_membership"
+template = "association/membership.html"
 
 FIELDS = (
     'name',
@@ -30,16 +30,16 @@
 REQUIRED = ('name', 'firstname', 'address', 'email', 'subscription')
 FormData = namedtuple("FormData", FIELDS)
 
-SUBJECT_ADMIN = D_(u"New subscription to the association")
-BODY_ADMIN = D_(u"""\
+SUBJECT_ADMIN = D_("New subscription to the association")
+BODY_ADMIN = D_("""\
 New subscription received:
 
 {fields_list}""").format(
-    fields_list=u"\n".join(u"- {0}: {{{0}}}".format(f) for f in FIELDS)
+    fields_list="\n".join("- {0}: {{{0}}}".format(f) for f in FIELDS)
     )
 
-SUBJECT = D_(u"Your association membership request")
-BODY = D_(u"""\
+SUBJECT = D_("Your association membership request")
+BODY = D_("""\
 Hello {firstname},
 
 you request to join the "Salut à Toi" association has been well received.
@@ -48,8 +48,8 @@
 You can contact us at contact"""
 # we split the address to avoid
 # it being recognized too easily by spam bots
-+ u'@' + u'salut-a-toi' + u'.org'
-u"""
++ '@' + 'salut-a-toi' + '.org'
+"""
 or on the official XMPP chat room:
 xmpp: sat@chat.jabberfr.org
 web: https://chat.jabberfr.org/converse.js/sat@chat.jabberfr.org
@@ -58,19 +58,19 @@
 """)
 
 WARNING_MSG_NOT_READ = D_(
-    u"You must have read the documents to validate your membership request")
+    "You must have read the documents to validate your membership request")
 WARNING_MSG_MISSING_FIELDS = D_(
-    u"The form you posted is not complete, we can't validate this membership request.\n"
-    u"Please fill all the required fields, thank you!")
+    "The form you posted is not complete, we can't validate this membership request.\n"
+    "Please fill all the required fields, thank you!")
 
 @defer.inlineCallbacks
 def on_data_post(self, request):
     data = FormData(*self.getPostedData(request, FIELDS, raise_on_missing=False))
     if any(not getattr(data, f) for f in REQUIRED):
-        log.warning(u"missing data fields:\n{data}".format(data=data))
+        log.warning("missing data fields:\n{data}".format(data=data))
         raise exceptions.DataError(WARNING_MSG_MISSING_FIELDS)
     if not C.bool(data.documents_read or C.BOOL_FALSE):
-        log.warning(u"documents_read has not been checked:\n{data}".format(data=data))
+        log.warning("documents_read has not been checked:\n{data}".format(data=data))
         raise exceptions.DataError(WARNING_MSG_NOT_READ)
     addresses = config.getConfig(
         self.host.main_conf,