comparison MoinMoin/action/quicklink.py @ 3059:036fc4dce2ee

fix quicklink action using same URL for link/unlink (thanks to Federico Lorenzi) (ported from 1.6)
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Thu, 21 Feb 2008 20:43:42 +0100
parents ba14d391c2ba
children a1322262398a
comparison
equal deleted inserted replaced
3058:f48d46b39364 3059:036fc4dce2ee
12 """ Add the current wiki page to the user quicklinks """ 12 """ Add the current wiki page to the user quicklinks """
13 _ = request.getText 13 _ = request.getText
14 14
15 if not request.user.valid: 15 if not request.user.valid:
16 request.theme.add_msg(_("You must login to add a quicklink."), "error") 16 request.theme.add_msg(_("You must login to add a quicklink."), "error")
17 elif request.user.isQuickLinkedTo([pagename]): 17 elif not request.user.isQuickLinkedTo([pagename]):
18 if request.user.removeQuicklink(pagename):
19 request.theme.add_msg(_('Your quicklink to this page has been removed.'), "info")
20 else: # should not happen
21 request.theme.add_msg(_('Your quicklink to this page could not be removed.'), "error")
22 else:
23 if request.user.addQuicklink(pagename): 18 if request.user.addQuicklink(pagename):
24 request.theme.add_msg(_('A quicklink to this page has been added for you.'), "info") 19 request.theme.add_msg(_('A quicklink to this page has been added for you.'), "info")
25 else: # should not happen 20 else: # should not happen
26 request.theme.add_msg(_('A quicklink to this page could not be added for you.'), "error") 21 request.theme.add_msg(_('A quicklink to this page could not be added for you.'), "error")
22 else:
23 request.theme.add_msg(_('You already have a quicklink to this page.', formatted=False))
27 24
28 Page(request, pagename).send_page() 25 Page(request, pagename).send_page()
29 26