| commit 87: | a0821d39bfd4 |
| parent 86: | ffbed20c95a1 |
| branch: | default |
Add a custom setting for extending the comments' timestamp (antispam)
Changed (Δ19 bytes):
raw changeset »
discussion/forms.py (2 lines added, 2 lines removed)
Up to file-list discussion/forms.py:
| … | … | @@ -32,10 +32,10 @@ class CommentForm(DjangoCommentForm): |
32 |
32 |
""" |
33 |
33 |
Make sure the timestamp isn't too far in the past. |
34 |
34 |
|
35 |
Extends the hard-coded timestamp check to |
|
35 |
Extends the hard-coded timestamp check to custom setting. |
|
36 |
36 |
""" |
37 |
37 |
ts = self.cleaned_data["timestamp"] |
38 |
if time.time() - ts > ( |
|
38 |
if time.time() - ts > (settings.BGK_TIMESTAMP_DURATION): |
|
39 |
39 |
raise forms.ValidationError("Timestamp check failed") |
40 |
40 |
return ts |
41 |
41 |
