1
# -*- coding: iso-8859-1 -*-
3
MoinMoin - unsubscribe from notifications to a page.
5
@copyright: 2000-2004 Juergen Hermann <jh@web.de>,
6
2006 MoinMoin:ThomasWaldmann
7
@license: GNU GPL, see COPYING for details.
9
from MoinMoin.Page import Page
11
def execute(pagename, request):
12
""" Unsubscribe the user from pagename """
14
if not request.user.valid:
15
actname = __name__.split('.')[-1]
16
request.theme.add_msg(_("You must login to use this action: %(action)s.") % {"action": actname}, "error")
17
return Page(request, pagename).send_page()
21
if request.user.isSubscribedTo([pagename]):
23
if request.user.unsubscribe(pagename):
24
msg = _('Your subscription to this page has been removed.')
26
msg = _("Can't remove regular expression subscription!") + u' ' + \
27
_("Edit the subscription regular expressions in your settings.")
29
# The user is not subscribed
30
msg = _('You need to be subscribed to unsubscribe.')
32
Page(request, pagename).send_page(msg=msg)