incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [9/16] git commit: [#4445] provide example of project.rate_limits
Date Fri, 21 Sep 2012 20:18:34 GMT
[#4445] provide example of project.rate_limits


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/b2bff47b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/b2bff47b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/b2bff47b

Branch: refs/heads/master
Commit: b2bff47bfdd4a17a97c18b83091def4b09085629
Parents: cf96eb0
Author: Dave Brondsema <dbrondsema@geek.net>
Authored: Fri Sep 21 14:55:00 2012 +0000
Committer: Dave Brondsema <dbrondsema@geek.net>
Committed: Fri Sep 21 14:55:56 2012 +0000

----------------------------------------------------------------------
 .../allura/tests/functional/test_neighborhood.py   |    4 ++--
 Allura/development.ini                             |    8 ++++++++
 2 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b2bff47b/Allura/allura/tests/functional/test_neighborhood.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_neighborhood.py b/Allura/allura/tests/functional/test_neighborhood.py
index 1a66945..44aeaa9 100644
--- a/Allura/allura/tests/functional/test_neighborhood.py
+++ b/Allura/allura/tests/functional/test_neighborhood.py
@@ -301,7 +301,7 @@ class TestNeighborhood(TestController):
                               extra_environ=dict(username='test-user-1'), status=302)
             assert '/p/rateproject1/admin' in r.location
 
-        # Set rate limit to 1 per hour
+        # Set rate limit to 1 in first hour of user account
         with h.push_config(config, **{'project.rate_limits': '{"3600": 1}'}):
             r = self.app.post('/p/register',
                               params=dict(project_unixname='rateproject2', project_name='Rate
project2', project_description='', neighborhood='Projects'),
@@ -320,7 +320,7 @@ class TestNeighborhood(TestController):
                               extra_environ=dict(username='root'), status=302)
             assert '/p/rateproject1/admin' in r.location
 
-        # Set rate limit to 1 per hour
+        # Set rate limit to 1 in first hour of user account
         with h.push_config(config, **{'project.rate_limits': '{"3600": 1}'}):
             r = self.app.post('/p/register',
                               params=dict(project_unixname='rateproject2', project_name='Rate
project2', project_description='', neighborhood='Projects'),

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b2bff47b/Allura/development.ini
----------------------------------------------------------------------
diff --git a/Allura/development.ini b/Allura/development.ini
index f53362a..60e3ad9 100644
--- a/Allura/development.ini
+++ b/Allura/development.ini
@@ -155,6 +155,14 @@ forgemail.domain = .in.sf.net
 forgemail.url = http://localhost:8080
 forgemail.return_path = noreply@sf.net
 
+# Specify the number of projects allowed to be created by a user
+# depending on the age of their user account.
+# Keys are number of seconds, values are max number of projects allowed 
+# (including the default user-project, so you probably want to add 1)
+# This example allows for 1 project if the account is less than an hour old
+# and 5 projects if the account is less than a day old.  No limits after that
+# project.rate_limits = {"3600": 2, "86400": 6}
+
 # Special Command settings
 # no need to sleep in devel
 ensure_index.sleep = 0


Mime
View raw message