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

« back to all changes in this revision

Viewing changes to MoinMoin/action/DeletePage.py

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2008-06-22 21:17:13 UTC
  • mto: This revision was merged to the branch mainline in revision 18.
  • Revision ID: james.westby@ubuntu.com-20080622211713-inlv5k4eifxckelr
ImportĀ upstreamĀ versionĀ 1.7.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
    def do_action(self):
45
45
        """ Delete pagename """
46
46
        form = self.form
47
 
        comment = form.get('comment', u'')
 
47
        comment = form.get('comment', [u''])[0]
48
48
        comment = wikiutil.clean_input(comment)
49
49
 
50
50
        # Create a page editor that does not do editor backups, because
53
53
        success, msgs = self.page.deletePage(comment)
54
54
 
55
55
        delete_subpages = 0
56
 
        try:
57
 
            delete_subpages = int(form['delete_subpages'])
58
 
        except:
59
 
            pass
 
56
        if 'delete_subpages' in form:
 
57
            try:
 
58
                delete_subpages = int(form['delete_subpages'][0])
 
59
            except:
 
60
                pass
60
61
 
61
62
        if delete_subpages and self.subpages:
62
63
            for name in self.subpages:
74
75
 
75
76
            d = {
76
77
                'subpage': subpages,
77
 
                'subpages_checked': ('', 'checked')[self.request.args.get('subpages_checked', '0') == '1'],
 
78
                'subpages_checked': ('', 'checked')[self.request.form.get('subpages_checked', ['0'])[0] == '1'],
78
79
                'subpage_label': _('Delete all /subpages too?'),
79
80
                'comment_label': _("Optional reason for the deletion"),
80
81
                'buttons_html': buttons_html,