~bkerensa/ubuntu/saucy/moin/1.9.5-5

« back to all changes in this revision

Viewing changes to MoinMoin/request/__init__.py

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2008-07-24 23:50:51 UTC
  • Revision ID: james.westby@ubuntu.com-20080724235051-qzjvwmfslyahnjnx
Tags: 1.7.1-1
* New upstream release.  Closes: bug#492233, thanks to Teodor.
  + Fixes bogus empty page creation.  Closes: bug#489146, thanks to
    Sam Morris.
* Recommend python-xml, needed for RSS feeds.  Closes: bug#488777,
  thanks to Sam Morris.
* Add patch 10001 to disable RenderAsDocbook if python-xml is not
  available. Closes: bug#487741, thanks to Franklin Piat.
* Update cdbs snippets:
  + Move dependency cleanup to new local snippet package-relations.mk.
  + Update copyright-check output to more closely match proposed new
    copyright file format.
  + Update README.cdbs-tweaks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
263
263
        if not limits:
264
264
            return False
265
265
 
 
266
        if self.remote_addr.startswith('127.'): # localnet
 
267
            return False
 
268
 
266
269
        validuser = self.user.valid
267
270
        current_id = validuser and self.user.name or self.remote_addr
268
 
        if not validuser and current_id.startswith('127.'): # localnet
269
 
            return False
270
271
        current_action = self.action
271
272
 
272
 
        default_limit = self.cfg.surge_action_limits.get('default', (30, 60))
 
273
        default_limit = limits.get('default', (30, 60))
273
274
 
274
275
        now = int(time.time())
275
276
        surgedict = {}
304
305
                if len(timestamps) < maxnum * 2:
305
306
                    timestamps.append((now + self.cfg.surge_lockout_time, surge_indicator)) # continue like that and get locked out
306
307
 
307
 
            if current_action != 'AttachFile': # don't add AttachFile accesses to all or picture galleries will trigger SP
 
308
            if current_action not in ('cache', 'AttachFile', ): # don't add cache/AttachFile accesses to all or picture galleries will trigger SP
308
309
                current_action = 'all' # put a total limit on user's requests
309
310
                maxnum, dt = limits.get(current_action, default_limit)
310
311
                events = surgedict.setdefault(current_id, {})