{"action":"created","comment":{"url":"https://api.github.com/repos/ella/ella-flatcomments/pulls/comments/29286194","id":29286194,"diff_hunk":"@@ -178,3 +185,34 @@ def save(self, **kwargs):\n         if self.submit_date is None:\n             self.submit_date = timezone.now()\n         super(FlatComment, self).save(**kwargs)\n+\n+    def has_edit_timer(self):\n+        '''has_edit_timer() -> bool\n+        '''\n+        return EDIT_TIMER_ENABLED\n+\n+    def is_edit_timer_expired(self):\n+        '''is_edit_timer_expired() -> bool\n+        Check whether the comment is still within the allowed edit time\n+        from the creation time.\n+        '''\n+        age = datetime.now(self.submit_date.tzinfo) - self.submit_date\n+        if age >= timedelta(minutes=EDIT_TIMER_MINUTES):\n+            return True\n+        return False\n+        \n+    def get_remaining_edit_time(self):\n+        '''get_remaining_edit_time() -> str\n+        Returns the remaining edit time from comment creation. The returned\n+        string is formatted as HH:MM:SS, e.g. 0:01:23\n+        '''\n+        age = datetime.now(self.submit_date.tzinfo) - self.submit_date\n+        edit_time = timedelta(minutes=EDIT_TIMER_MINUTES)","path":"ella_flatcomments/models.py","position":46,"original_position":46,"commit_id":"0175a1d1650040253d5cab5b17bca40ae82e073f","original_commit_id":"0175a1d1650040253d5cab5b17bca40ae82e073f","user":{"login":"HonzaKral","id":32132,"avatar_url":"https://avatars.githubusercontent.com/u/32132?v=3","gravatar_id":"","url":"https://api.github.com/users/HonzaKral","html_url":"https://github.com/HonzaKral","followers_url":"https://api.github.com/users/HonzaKral/followers","following_url":"https://api.github.com/users/HonzaKral/following{/other_user}","gists_url":"https://api.github.com/users/HonzaKral/gists{/gist_id}","starred_url":"https://api.github.com/users/HonzaKral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HonzaKral/subscriptions","organizations_url":"https://api.github.com/users/HonzaKral/orgs","repos_url":"https://api.github.com/users/HonzaKral/repos","events_url":"https://api.github.com/users/HonzaKral/events{/privacy}","received_events_url":"https://api.github.com/users/HonzaKral/received_events","type":"User","site_admin":false},"body":"construct edit_time flobally and just reuse it, no need to keep reconstructing the `timedelta` object","created_at":"2015-04-28T20:42:19Z","updated_at":"2015-04-28T20:42:19Z","html_url":"https://github.com/ella/ella-flatcomments/pull/9#discussion_r29286194","pull_request_url":"https://api.github.com/repos/ella/ella-flatcomments/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/ella/ella-flatcomments/pulls/comments/29286194"},"html":{"href":"https://github.com/ella/ella-flatcomments/pull/9#discussion_r29286194"},"pull_request":{"href":"https://api.github.com/repos/ella/ella-flatcomments/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/ella/ella-flatcomments/pulls/9","id":34307186,"html_url":"https://github.com/ella/ella-flatcomments/pull/9","diff_url":"https://github.com/ella/ella-flatcomments/pull/9.diff","patch_url":"https://github.com/ella/ella-flatcomments/pull/9.patch","issue_url":"https://api.github.com/repos/ella/ella-flatcomments/issues/9","number":9,"state":"open","locked":false,"title":"Feature/akismet comment check","user":{"login":"matthappens","id":1832353,"avatar_url":"https://avatars.githubusercontent.com/u/1832353?v=3","gravatar_id":"","url":"https://api.github.com/users/matthappens","html_url":"https://github.com/matthappens","followers_url":"https://api.github.com/users/matthappens/followers","following_url":"https://api.github.com/users/matthappens/following{/other_user}","gists_url":"https://api.github.com/users/matthappens/gists{/gist_id}","starred_url":"https://api.github.com/users/matthappens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthappens/subscriptions","organizations_url":"https://api.github.com/users/matthappens/orgs","repos_url":"https://api.github.com/users/matthappens/repos","events_url":"https://api.github.com/users/matthappens/events{/privacy}","received_events_url":"https://api.github.com/users/matthappens/received_events","type":"User","site_admin":false},"body":"Right now, FlatComment.post supports a request parameter, but that parameter is not passed in through the creating view. \r\nIn this branch, I've added the request as a parameter so that it can be used in comment checks or other functions run in response to comment_will_be_posted signals","created_at":"2015-04-28T20:24:09Z","updated_at":"2015-04-28T20:42:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"430615b776625e3bab35833b222101dedc0150dd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ella/ella-flatcomments/pulls/9/commits","review_comments_url":"https://api.github.com/repos/ella/ella-flatcomments/pulls/9/comments","review_comment_url":"https://api.github.com/repos/ella/ella-flatcomments/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ella/ella-flatcomments/issues/9/comments","statuses_url":"https://api.github.com/repos/ella/ella-flatcomments/statuses/0175a1d1650040253d5cab5b17bca40ae82e073f","head":{"label":"WhiskeyMedia:feature/akismet-comment-check","ref":"feature/akismet-comment-check","sha":"0175a1d1650040253d5cab5b17bca40ae82e073f","user":{"login":"WhiskeyMedia","id":324509,"avatar_url":"https://avatars.githubusercontent.com/u/324509?v=3","gravatar_id":"","url":"https://api.github.com/users/WhiskeyMedia","html_url":"https://github.com/WhiskeyMedia","followers_url":"https://api.github.com/users/WhiskeyMedia/followers","following_url":"https://api.github.com/users/WhiskeyMedia/following{/other_user}","gists_url":"https://api.github.com/users/WhiskeyMedia/gists{/gist_id}","starred_url":"https://api.github.com/users/WhiskeyMedia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WhiskeyMedia/subscriptions","organizations_url":"https://api.github.com/users/WhiskeyMedia/orgs","repos_url":"https://api.github.com/users/WhiskeyMedia/repos","events_url":"https://api.github.com/users/WhiskeyMedia/events{/privacy}","received_events_url":"https://api.github.com/users/WhiskeyMedia/received_events","type":"Organization","site_admin":false},"repo":{"id":12307216,"name":"ella-flatcomments","full_name":"WhiskeyMedia/ella-flatcomments","owner":{"login":"WhiskeyMedia","id":324509,"avatar_url":"https://avatars.githubusercontent.com/u/324509?v=3","gravatar_id":"","url":"https://api.github.com/users/WhiskeyMedia","html_url":"https://github.com/WhiskeyMedia","followers_url":"https://api.github.com/users/WhiskeyMedia/followers","following_url":"https://api.github.com/users/WhiskeyMedia/following{/other_user}","gists_url":"https://api.github.com/users/WhiskeyMedia/gists{/gist_id}","starred_url":"https://api.github.com/users/WhiskeyMedia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WhiskeyMedia/subscriptions","organizations_url":"https://api.github.com/users/WhiskeyMedia/orgs","repos_url":"https://api.github.com/users/WhiskeyMedia/repos","events_url":"https://api.github.com/users/WhiskeyMedia/events{/privacy}","received_events_url":"https://api.github.com/users/WhiskeyMedia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WhiskeyMedia/ella-flatcomments","description":"Flat comments for CMS ella utilizing redis for speed.","fork":true,"url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments","forks_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/forks","keys_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/teams","hooks_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/hooks","issue_events_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/issues/events{/number}","events_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/events","assignees_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/assignees{/user}","branches_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/branches{/branch}","tags_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/tags","blobs_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/git/refs{/sha}","trees_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/statuses/{sha}","languages_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/languages","stargazers_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/stargazers","contributors_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/contributors","subscribers_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/subscribers","subscription_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/subscription","commits_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/commits{/sha}","git_commits_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/git/commits{/sha}","comments_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/comments{/number}","issue_comment_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/issues/comments{/number}","contents_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/contents/{+path}","compare_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/merges","archive_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/downloads","issues_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/issues{/number}","pulls_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/pulls{/number}","milestones_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/milestones{/number}","notifications_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/labels{/name}","releases_url":"https://api.github.com/repos/WhiskeyMedia/ella-flatcomments/releases{/id}","created_at":"2013-08-22T20:30:24Z","updated_at":"2014-07-29T16:09:06Z","pushed_at":"2015-04-23T23:37:54Z","git_url":"git://github.com/WhiskeyMedia/ella-flatcomments.git","ssh_url":"git@github.com:WhiskeyMedia/ella-flatcomments.git","clone_url":"https://github.com/WhiskeyMedia/ella-flatcomments.git","svn_url":"https://github.com/WhiskeyMedia/ella-flatcomments","homepage":null,"size":291,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ella:master","ref":"master","sha":"f98f0f421cc215a5e3561910d5b73e73393cbf68","user":{"login":"ella","id":55843,"avatar_url":"https://avatars.githubusercontent.com/u/55843?v=3","gravatar_id":"","url":"https://api.github.com/users/ella","html_url":"https://github.com/ella","followers_url":"https://api.github.com/users/ella/followers","following_url":"https://api.github.com/users/ella/following{/other_user}","gists_url":"https://api.github.com/users/ella/gists{/gist_id}","starred_url":"https://api.github.com/users/ella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ella/subscriptions","organizations_url":"https://api.github.com/users/ella/orgs","repos_url":"https://api.github.com/users/ella/repos","events_url":"https://api.github.com/users/ella/events{/privacy}","received_events_url":"https://api.github.com/users/ella/received_events","type":"Organization","site_admin":false},"repo":{"id":6388474,"name":"ella-flatcomments","full_name":"ella/ella-flatcomments","owner":{"login":"ella","id":55843,"avatar_url":"https://avatars.githubusercontent.com/u/55843?v=3","gravatar_id":"","url":"https://api.github.com/users/ella","html_url":"https://github.com/ella","followers_url":"https://api.github.com/users/ella/followers","following_url":"https://api.github.com/users/ella/following{/other_user}","gists_url":"https://api.github.com/users/ella/gists{/gist_id}","starred_url":"https://api.github.com/users/ella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ella/subscriptions","organizations_url":"https://api.github.com/users/ella/orgs","repos_url":"https://api.github.com/users/ella/repos","events_url":"https://api.github.com/users/ella/events{/privacy}","received_events_url":"https://api.github.com/users/ella/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ella/ella-flatcomments","description":"Flat comments for CMS ella utilizing redis for speed.","fork":false,"url":"https://api.github.com/repos/ella/ella-flatcomments","forks_url":"https://api.github.com/repos/ella/ella-flatcomments/forks","keys_url":"https://api.github.com/repos/ella/ella-flatcomments/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ella/ella-flatcomments/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ella/ella-flatcomments/teams","hooks_url":"https://api.github.com/repos/ella/ella-flatcomments/hooks","issue_events_url":"https://api.github.com/repos/ella/ella-flatcomments/issues/events{/number}","events_url":"https://api.github.com/repos/ella/ella-flatcomments/events","assignees_url":"https://api.github.com/repos/ella/ella-flatcomments/assignees{/user}","branches_url":"https://api.github.com/repos/ella/ella-flatcomments/branches{/branch}","tags_url":"https://api.github.com/repos/ella/ella-flatcomments/tags","blobs_url":"https://api.github.com/repos/ella/ella-flatcomments/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ella/ella-flatcomments/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ella/ella-flatcomments/git/refs{/sha}","trees_url":"https://api.github.com/repos/ella/ella-flatcomments/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ella/ella-flatcomments/statuses/{sha}","languages_url":"https://api.github.com/repos/ella/ella-flatcomments/languages","stargazers_url":"https://api.github.com/repos/ella/ella-flatcomments/stargazers","contributors_url":"https://api.github.com/repos/ella/ella-flatcomments/contributors","subscribers_url":"https://api.github.com/repos/ella/ella-flatcomments/subscribers","subscription_url":"https://api.github.com/repos/ella/ella-flatcomments/subscription","commits_url":"https://api.github.com/repos/ella/ella-flatcomments/commits{/sha}","git_commits_url":"https://api.github.com/repos/ella/ella-flatcomments/git/commits{/sha}","comments_url":"https://api.github.com/repos/ella/ella-flatcomments/comments{/number}","issue_comment_url":"https://api.github.com/repos/ella/ella-flatcomments/issues/comments{/number}","contents_url":"https://api.github.com/repos/ella/ella-flatcomments/contents/{+path}","compare_url":"https://api.github.com/repos/ella/ella-flatcomments/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ella/ella-flatcomments/merges","archive_url":"https://api.github.com/repos/ella/ella-flatcomments/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ella/ella-flatcomments/downloads","issues_url":"https://api.github.com/repos/ella/ella-flatcomments/issues{/number}","pulls_url":"https://api.github.com/repos/ella/ella-flatcomments/pulls{/number}","milestones_url":"https://api.github.com/repos/ella/ella-flatcomments/milestones{/number}","notifications_url":"https://api.github.com/repos/ella/ella-flatcomments/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ella/ella-flatcomments/labels{/name}","releases_url":"https://api.github.com/repos/ella/ella-flatcomments/releases{/id}","created_at":"2012-10-25T14:25:47Z","updated_at":"2014-03-02T22:30:35Z","pushed_at":"2015-04-28T20:24:09Z","git_url":"git://github.com/ella/ella-flatcomments.git","ssh_url":"git@github.com:ella/ella-flatcomments.git","clone_url":"https://github.com/ella/ella-flatcomments.git","svn_url":"https://github.com/ella/ella-flatcomments","homepage":null,"size":301,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ella/ella-flatcomments/pulls/9"},"html":{"href":"https://github.com/ella/ella-flatcomments/pull/9"},"issue":{"href":"https://api.github.com/repos/ella/ella-flatcomments/issues/9"},"comments":{"href":"https://api.github.com/repos/ella/ella-flatcomments/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/ella/ella-flatcomments/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/ella/ella-flatcomments/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ella/ella-flatcomments/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/ella/ella-flatcomments/statuses/0175a1d1650040253d5cab5b17bca40ae82e073f"}}}}