changeset 5255:ec00e39ec3f8

use correct check_surge_protect() call
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 07 Nov 2009 18:09:23 +0100
parents fc47ff90b96f
children e2dcd2e9b73a
files MoinMoin/action/edit.py MoinMoin/action/fullsearch.py
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/edit.py	Sat Nov 07 04:52:08 2009 +0100
+++ b/MoinMoin/action/edit.py	Sat Nov 07 18:09:23 2009 +0100
@@ -10,6 +10,7 @@
 """
 from MoinMoin import wikiutil
 from MoinMoin.Page import Page
+from MoinMoin.web.utils import check_surge_protect
 
 def execute(pagename, request):
     """ edit a page """
@@ -17,8 +18,7 @@
 
     if 'button_preview' in request.form and 'button_spellcheck' in request.form:
         # multiple buttons pressed at once? must be some spammer/bot
-        request.surge_protect(kick_him=True) # get rid of him
-        request.makeForbidden(403, '')
+        check_surge_protect(request, kick=True) # get rid of him
         return
 
     if not request.user.may.write(pagename):
--- a/MoinMoin/action/fullsearch.py	Sat Nov 07 04:52:08 2009 +0100
+++ b/MoinMoin/action/fullsearch.py	Sat Nov 07 18:09:23 2009 +0100
@@ -12,6 +12,7 @@
 from MoinMoin.Page import Page
 from MoinMoin import wikiutil
 from MoinMoin.support.parsedatetime.parsedatetime import Calendar
+from MoinMoin.web.utils import check_surge_protect
 
 def checkTitleSearch(request):
     """ Return 1 for title search, 0 for full text search, -1 for idiot spammer
@@ -60,8 +61,7 @@
     _ = request.getText
     titlesearch = checkTitleSearch(request)
     if titlesearch < 0:
-        request.surge_protect(kick_him=True) # get rid of spammer
-        request.makeForbidden(403, '')
+        check_surge_protect(request, kick=True) # get rid of spammer
         return
 
     advancedsearch = isAdvancedSearch(request)