~ubuntu-branches/ubuntu/natty/moin/natty-updates

« back to all changes in this revision

Viewing changes to MoinMoin/action/quickunlink.py

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2008-06-22 21:17:13 UTC
  • mfrom: (0.9.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080622211713-fpo2zrq3s5dfecxg
Tags: 1.7.0-3
Simplify /etc/moin/wikilist format: "USER URL" (drop unneeded middle
CONFIG_DIR that was wrongly advertised as DATA_DIR).  Make
moin-mass-migrate handle both formats and warn about deprecation of
the old one.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: iso-8859-1 -*-
 
2
"""
 
3
    MoinMoin - remove a quicklink from the user's quicklinks
 
4
 
 
5
    @copyright: 2000-2004 Juergen Hermann <jh@web.de>,
 
6
                2006 MoinMoin:ThomasWaldmann
 
7
    @license: GNU GPL, see COPYING for details.
 
8
"""
 
9
from MoinMoin.Page import Page
 
10
 
 
11
def execute(pagename, request):
 
12
    """ Remove the current wiki page from the user's quicklinks """
 
13
    _ = request.getText
 
14
    msg = None
 
15
 
 
16
    if not request.user.valid:
 
17
        msg = _("You must login to remove a quicklink.")
 
18
    elif request.user.isQuickLinkedTo([pagename]):
 
19
        if request.user.removeQuicklink(pagename):
 
20
            msg = _('Your quicklink to this page has been removed.')
 
21
        else: # should not happen
 
22
            msg = _('Your quicklink to this page could not be removed.')
 
23
    else:
 
24
        msg = _('You need to have a quicklink to this page to remove it.')
 
25
 
 
26
    Page(request, pagename).send_page(msg=msg)