changeset 1913:6769679b26f6

quicklink action: give msg if quicklink toggle failed
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 26 Mar 2007 00:20:53 +0200
parents 901ff624d942
children eb68960b1dfb
files MoinMoin/action/quicklink.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/quicklink.py	Mon Mar 26 00:14:53 2007 +0200
+++ b/MoinMoin/action/quicklink.py	Mon Mar 26 00:20:53 2007 +0200
@@ -9,10 +9,7 @@
 from MoinMoin.Page import Page
 
 def execute(pagename, request):
-    """ Add the current wiki page to the user quicklinks 
-    
-    TODO: what if add or remove quicklink fail? display an error message?
-    """
+    """ Add the current wiki page to the user quicklinks """
     _ = request.getText
     msg = None
 
@@ -21,9 +18,13 @@
     elif request.user.isQuickLinkedTo([pagename]):
         if request.user.removeQuicklink(pagename):
             msg = _('Your quicklink to this page has been removed.')
+        else: # should not happen
+            msg = _('Your quicklink to this page could not be removed.')
     else:
         if request.user.addQuicklink(pagename):
             msg = _('A quicklink to this page has been added for you.')
+        else: # should not happen
+            msg = _('A quicklink to this page could not be added for you.')
 
     Page(request, pagename).send_page(msg=msg)