Blob Blame History Raw
Index: /accountmanagerplugin/trunk/acct_mgr/web_ui.py
===================================================================
--- /accountmanagerplugin/trunk/acct_mgr/web_ui.py (revision 4638)
+++ /accountmanagerplugin/trunk/acct_mgr/web_ui.py (revision 5478)
@@ -25,4 +25,5 @@
 from trac.web import chrome
 from trac.web.chrome import INavigationContributor, ITemplateProvider
+from genshi.core import Markup
 from genshi.builder import tag
 
@@ -236,5 +237,5 @@
                     del(req.session['force_change_passwd'])
                     req.session.save()
-                    chrome.add_notice(req, MessageWrapper(tag(
+                    chrome.add_notice(req, Markup(tag(
                         "Thank you for taking the time to update your password."
                     )))
@@ -245,5 +246,5 @@
                 data.update({'error': 'Invalid action'})
         if force_change_password:
-            chrome.add_warning(req, MessageWrapper(tag(
+            chrome.add_warning(req, Markup(tag(
                 "You are required to change password because of a recent "
                 "password change request. ",
@@ -500,14 +501,4 @@
 
 
-class MessageWrapper(object):
-    """Wrapper for add_warning and add_notice to work around the requirement
-    for a % operator."""
-    def __init__(self, body):
-        self.body = body
-
-    def __mod__(self, rhs):
-        return self.body
-
-
 class EmailVerificationNotification(SingleUserNofification):
     template_name = 'verify_email.txt'
@@ -542,5 +533,5 @@
             return handler
         if handler is not self and 'email_verification_token' in req.session:
-            chrome.add_warning(req, MessageWrapper(tag.span(
+            chrome.add_warning(req, Markup(tag.span(
                     'Your permissions have been limited until you ',
                     tag.a(href=req.href.verify_email())(
@@ -559,5 +550,5 @@
             req.session['email_verification_sent_to'] = req.session.get('email')
             self._send_email(req)
-            chrome.add_notice(req, MessageWrapper(tag.span(
+            chrome.add_notice(req, Markup(tag.span(
                     'An email has been sent to ', req.session['email'],
                     ' with a token to ',