david / biologeek (http://biologeek.com/)

Source code of biologeek.com weblog under WTFPL.

Clone this repository (size: 252.8 KB): HTTPS / SSH
$ hg clone http://code.welldev.org/biologeek/

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 4 hours (vs. 2).
35
        Extends the hard-coded timestamp check to custom setting.
36
36
        """
37
37
        ts = self.cleaned_data["timestamp"]
38
        if time.time() - ts > (4 * 60 * 60):
38
        if time.time() - ts > (settings.BGK_TIMESTAMP_DURATION):
39
39
            raise forms.ValidationError("Timestamp check failed")
40
40
        return ts
41
41