Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added AGORA_EDIT_TIMEOUT setting

  • Loading branch information...
commit 81fc5ccec7d89adeac9f3e98ea427adeb1b0eb77 1 parent a2072cc
@brosner brosner authored
Showing with 4 additions and 3 deletions.
  1. +2 −2 agora/models.py
  2. +2 −1  agora/settings.py
View
4 agora/models.py
@@ -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
3  agora/settings.py
@@ -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))
Please sign in to comment.
Something went wrong with that request. Please try again.