changeset 4633:a306904a3620

unsubscribe action: add msg types so icons get displayed
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 24 Feb 2009 10:08:55 +0100
parents 81598e8c735b
children 28a5a548d6f5
files MoinMoin/action/unsubscribe.py
diffstat 1 files changed, 3 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/unsubscribe.py	Sat Feb 21 19:23:44 2009 +0100
+++ b/MoinMoin/action/unsubscribe.py	Tue Feb 24 10:08:55 2009 +0100
@@ -16,19 +16,16 @@
         request.theme.add_msg(_("You must login to use this action: %(action)s.") % {"action": actname}, "error")
         return Page(request, pagename).send_page()
 
-    msg = None
-
     if request.user.isSubscribedTo([pagename]):
         # Try to unsubscribe
         if request.user.unsubscribe(pagename):
-            msg = _('Your subscription to this page has been removed.')
+            request.theme.add_msg(_('Your subscription to this page has been removed.'), "info")
         else:
             msg = _("Can't remove regular expression subscription!") + u' ' + \
                   _("Edit the subscription regular expressions in your settings.")
+            request.theme.add_msg(msg, "error")
     else:
         # The user is not subscribed
-        msg = _('You need to be subscribed to unsubscribe.')
-    if msg:
-        request.theme.add_msg(msg)
+        request.theme.add_msg(_('You need to be subscribed to unsubscribe.'), "info")
     Page(request, pagename).send_page()