annotate MoinMoin/action/unsubscribe.py @ 3333:928a45b60bb3

remove remaining mentions of "UserPreferences", add to CHANGES
author Johannes Berg <johannes AT sipsolutions DOT net>
date Wed, 19 Mar 2008 12:45:14 +0100
parents 8a1f1a9dd37f
children c9f5e4f9a76e
rev   line source
3058
f48d46b39364 fix MoinMoinBugs/SubscribeAndUnsubscribeShareSameUrl (thanks to Federico Lorenzi) (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
1 # -*- coding: iso-8859-1 -*-
f48d46b39364 fix MoinMoinBugs/SubscribeAndUnsubscribeShareSameUrl (thanks to Federico Lorenzi) (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
2 """
f48d46b39364 fix MoinMoinBugs/SubscribeAndUnsubscribeShareSameUrl (thanks to Federico Lorenzi) (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
3 MoinMoin - unsubscribe from notifications to a page.
f48d46b39364 fix MoinMoinBugs/SubscribeAndUnsubscribeShareSameUrl (thanks to Federico Lorenzi) (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
4
f48d46b39364 fix MoinMoinBugs/SubscribeAndUnsubscribeShareSameUrl (thanks to Federico Lorenzi) (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
5 @copyright: 2000-2004 Juergen Hermann <jh@web.de>,
f48d46b39364 fix MoinMoinBugs/SubscribeAndUnsubscribeShareSameUrl (thanks to Federico Lorenzi) (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
6 2006 MoinMoin:ThomasWaldmann
f48d46b39364 fix MoinMoinBugs/SubscribeAndUnsubscribeShareSameUrl (thanks to Federico Lorenzi) (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
7 @license: GNU GPL, see COPYING for details.
f48d46b39364 fix MoinMoinBugs/SubscribeAndUnsubscribeShareSameUrl (thanks to Federico Lorenzi) (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
8 """
f48d46b39364 fix MoinMoinBugs/SubscribeAndUnsubscribeShareSameUrl (thanks to Federico Lorenzi) (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
9 from MoinMoin.Page import Page
f48d46b39364 fix MoinMoinBugs/SubscribeAndUnsubscribeShareSameUrl (thanks to Federico Lorenzi) (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
10
f48d46b39364 fix MoinMoinBugs/SubscribeAndUnsubscribeShareSameUrl (thanks to Federico Lorenzi) (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
11 def execute(pagename, request):
f48d46b39364 fix MoinMoinBugs/SubscribeAndUnsubscribeShareSameUrl (thanks to Federico Lorenzi) (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
12 """ Unsubscribe the user from pagename """
f48d46b39364 fix MoinMoinBugs/SubscribeAndUnsubscribeShareSameUrl (thanks to Federico Lorenzi) (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
13 _ = request.getText
f48d46b39364 fix MoinMoinBugs/SubscribeAndUnsubscribeShareSameUrl (thanks to Federico Lorenzi) (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
14 msg = None
f48d46b39364 fix MoinMoinBugs/SubscribeAndUnsubscribeShareSameUrl (thanks to Federico Lorenzi) (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
15
f48d46b39364 fix MoinMoinBugs/SubscribeAndUnsubscribeShareSameUrl (thanks to Federico Lorenzi) (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
16 if request.user.isSubscribedTo([pagename]):
f48d46b39364 fix MoinMoinBugs/SubscribeAndUnsubscribeShareSameUrl (thanks to Federico Lorenzi) (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
17 # Try to unsubscribe
f48d46b39364 fix MoinMoinBugs/SubscribeAndUnsubscribeShareSameUrl (thanks to Federico Lorenzi) (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
18 if request.user.unsubscribe(pagename):
3122
a1322262398a refactored _() getText calls to match new api
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3058
diff changeset
19 msg = _('Your subscription to this page has been removed.')
3058
f48d46b39364 fix MoinMoinBugs/SubscribeAndUnsubscribeShareSameUrl (thanks to Federico Lorenzi) (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
20 else:
3122
a1322262398a refactored _() getText calls to match new api
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3058
diff changeset
21 msg = _("Can't remove regular expression subscription!") + u' ' + \
3333
928a45b60bb3 remove remaining mentions of "UserPreferences", add to CHANGES
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3211
diff changeset
22 _("Edit the subscription regular expressions in your settings.")
3058
f48d46b39364 fix MoinMoinBugs/SubscribeAndUnsubscribeShareSameUrl (thanks to Federico Lorenzi) (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
23 else:
f48d46b39364 fix MoinMoinBugs/SubscribeAndUnsubscribeShareSameUrl (thanks to Federico Lorenzi) (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
24 # The user is not subscribed
3122
a1322262398a refactored _() getText calls to match new api
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3058
diff changeset
25 msg = _('You need to be subscribed to unsubscribe.')
3058
f48d46b39364 fix MoinMoinBugs/SubscribeAndUnsubscribeShareSameUrl (thanks to Federico Lorenzi) (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
26
f48d46b39364 fix MoinMoinBugs/SubscribeAndUnsubscribeShareSameUrl (thanks to Federico Lorenzi) (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
27 Page(request, pagename).send_page(msg=msg)
f48d46b39364 fix MoinMoinBugs/SubscribeAndUnsubscribeShareSameUrl (thanks to Federico Lorenzi) (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents:
diff changeset
28