Permalink
Browse files

added AGORA_EDIT_TIMEOUT setting

  • Loading branch information...
1 parent a2072cc commit 81fc5ccec7d89adeac9f3e98ea427adeb1b0eb77 @brosner brosner committed Dec 17, 2011
Showing with 4 additions and 3 deletions.
  1. +2 −2 agora/models.py
  2. +2 −1 agora/settings.py
View
@@ -10,7 +10,7 @@
from django.contrib.auth.models import User
from agora.managers import ForumThreadManager
-from agora.settings import PARSER
+from agora.settings import PARSER, EDIT_TIMEOUT
from agora.utils import load_path_attr
@@ -253,7 +253,7 @@ def save(self, **kwargs):
# allow editing for short period after posting
def editable(self, user):
if user == self.author:
- if datetime.datetime.now() < self.created + datetime.timedelta(minutes=30): # @@@ factor out time interval
+ if datetime.datetime.now() < self.created + datetime.timedelta(**EDIT_TIMEOUT):
return True
return False
View
@@ -1,4 +1,5 @@
from django.conf import settings
-PARSER = getattr(settings, "AGORA_PARSER", ["agora.utils.default_text", {}])
+PARSER = getattr(settings, "AGORA_PARSER", ["agora.utils.default_text", {}])
+EDIT_TIMEOUT = getattr(settings, "AGORA_EDIT_TIMEOUT", dict(minutes=3))

0 comments on commit 81fc5cc

Please sign in to comment.