{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/kuma/pulls/comments/26206214","id":26206214,"diff_hunk":"@@ -48,6 +48,24 @@ def revisions(request):\n                         datetime.datetime.now())\n             query_kwargs['created__range'] = [start_date, end_date]\n \n+        preceding_period = filter_form.cleaned_data['preceding_period']\n+        if preceding_period:\n+            # these are messy but work with timedelta's seconds format,\n+            # and keep the form and url arguments human readable\n+            if preceding_period == 'month':\n+                seconds = 30 * 24 * 60 * 60\n+            if preceding_period == 'week':\n+                seconds = 7 * 24 * 60 * 60\n+            if preceding_period == 'day':\n+                seconds = 24 * 60 * 60\n+            if preceding_period == 'hour':\n+                seconds = 60 * 60\n+            # use the form date if present, otherwise, offset from now\n+            end_date = (filter_form.cleaned_data['end_date'] or\n+                        datetime.datetime.now())\n+            start_date = end_date - datetime.timedelta(seconds=seconds)","path":"kuma/dashboards/views.py","position":19,"original_position":19,"commit_id":"64df468475b441b97bb937bb01d135e1dc4703fb","original_commit_id":"64df468475b441b97bb937bb01d135e1dc4703fb","user":{"login":"jezdez","id":1610,"avatar_url":"https://avatars.githubusercontent.com/u/1610?v=3","gravatar_id":"","url":"https://api.github.com/users/jezdez","html_url":"https://github.com/jezdez","followers_url":"https://api.github.com/users/jezdez/followers","following_url":"https://api.github.com/users/jezdez/following{/other_user}","gists_url":"https://api.github.com/users/jezdez/gists{/gist_id}","starred_url":"https://api.github.com/users/jezdez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jezdez/subscriptions","organizations_url":"https://api.github.com/users/jezdez/orgs","repos_url":"https://api.github.com/users/jezdez/repos","events_url":"https://api.github.com/users/jezdez/events{/privacy}","received_events_url":"https://api.github.com/users/jezdez/received_events","type":"User","site_admin":false},"body":"Please use `django.utils.timezone.now()` here instead in preparation for enabling Django's timezone support.","created_at":"2015-03-11T12:02:02Z","updated_at":"2015-03-11T12:02:02Z","html_url":"https://github.com/mozilla/kuma/pull/3104#discussion_r26206214","pull_request_url":"https://api.github.com/repos/mozilla/kuma/pulls/3104","_links":{"self":{"href":"https://api.github.com/repos/mozilla/kuma/pulls/comments/26206214"},"html":{"href":"https://github.com/mozilla/kuma/pull/3104#discussion_r26206214"},"pull_request":{"href":"https://api.github.com/repos/mozilla/kuma/pulls/3104"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/kuma/pulls/3104","id":30669837,"html_url":"https://github.com/mozilla/kuma/pull/3104","diff_url":"https://github.com/mozilla/kuma/pull/3104.diff","patch_url":"https://github.com/mozilla/kuma/pull/3104.patch","issue_url":"https://api.github.com/repos/mozilla/kuma/issues/3104","number":3104,"state":"open","locked":false,"title":"fix bug 1140436: add period url param & select box to revisions dashboard","user":{"login":"jamonation","id":328553,"avatar_url":"https://avatars.githubusercontent.com/u/328553?v=3","gravatar_id":"","url":"https://api.github.com/users/jamonation","html_url":"https://github.com/jamonation","followers_url":"https://api.github.com/users/jamonation/followers","following_url":"https://api.github.com/users/jamonation/following{/other_user}","gists_url":"https://api.github.com/users/jamonation/gists{/gist_id}","starred_url":"https://api.github.com/users/jamonation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamonation/subscriptions","organizations_url":"https://api.github.com/users/jamonation/orgs","repos_url":"https://api.github.com/users/jamonation/repos","events_url":"https://api.github.com/users/jamonation/events{/privacy}","received_events_url":"https://api.github.com/users/jamonation/received_events","type":"User","site_admin":false},"body":"I think that this needs some i18n polish (because I don't know how that system works in Kuma), but it filters by hour/day/week/month per @a2sheppy's feature request.","created_at":"2015-03-06T18:57:18Z","updated_at":"2015-03-11T12:02:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fa4aebe2a7de7b4afdb3557209062b6a6abcfede","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/kuma/pulls/3104/commits","review_comments_url":"https://api.github.com/repos/mozilla/kuma/pulls/3104/comments","review_comment_url":"https://api.github.com/repos/mozilla/kuma/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/kuma/issues/3104/comments","statuses_url":"https://api.github.com/repos/mozilla/kuma/statuses/64df468475b441b97bb937bb01d135e1dc4703fb","head":{"label":"jamonation:bug-114036","ref":"bug-114036","sha":"64df468475b441b97bb937bb01d135e1dc4703fb","user":{"login":"jamonation","id":328553,"avatar_url":"https://avatars.githubusercontent.com/u/328553?v=3","gravatar_id":"","url":"https://api.github.com/users/jamonation","html_url":"https://github.com/jamonation","followers_url":"https://api.github.com/users/jamonation/followers","following_url":"https://api.github.com/users/jamonation/following{/other_user}","gists_url":"https://api.github.com/users/jamonation/gists{/gist_id}","starred_url":"https://api.github.com/users/jamonation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamonation/subscriptions","organizations_url":"https://api.github.com/users/jamonation/orgs","repos_url":"https://api.github.com/users/jamonation/repos","events_url":"https://api.github.com/users/jamonation/events{/privacy}","received_events_url":"https://api.github.com/users/jamonation/received_events","type":"User","site_admin":false},"repo":{"id":21593917,"name":"kuma","full_name":"jamonation/kuma","owner":{"login":"jamonation","id":328553,"avatar_url":"https://avatars.githubusercontent.com/u/328553?v=3","gravatar_id":"","url":"https://api.github.com/users/jamonation","html_url":"https://github.com/jamonation","followers_url":"https://api.github.com/users/jamonation/followers","following_url":"https://api.github.com/users/jamonation/following{/other_user}","gists_url":"https://api.github.com/users/jamonation/gists{/gist_id}","starred_url":"https://api.github.com/users/jamonation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamonation/subscriptions","organizations_url":"https://api.github.com/users/jamonation/orgs","repos_url":"https://api.github.com/users/jamonation/repos","events_url":"https://api.github.com/users/jamonation/events{/privacy}","received_events_url":"https://api.github.com/users/jamonation/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jamonation/kuma","description":"The Django project that powers MDN.","fork":true,"url":"https://api.github.com/repos/jamonation/kuma","forks_url":"https://api.github.com/repos/jamonation/kuma/forks","keys_url":"https://api.github.com/repos/jamonation/kuma/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jamonation/kuma/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jamonation/kuma/teams","hooks_url":"https://api.github.com/repos/jamonation/kuma/hooks","issue_events_url":"https://api.github.com/repos/jamonation/kuma/issues/events{/number}","events_url":"https://api.github.com/repos/jamonation/kuma/events","assignees_url":"https://api.github.com/repos/jamonation/kuma/assignees{/user}","branches_url":"https://api.github.com/repos/jamonation/kuma/branches{/branch}","tags_url":"https://api.github.com/repos/jamonation/kuma/tags","blobs_url":"https://api.github.com/repos/jamonation/kuma/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jamonation/kuma/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jamonation/kuma/git/refs{/sha}","trees_url":"https://api.github.com/repos/jamonation/kuma/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jamonation/kuma/statuses/{sha}","languages_url":"https://api.github.com/repos/jamonation/kuma/languages","stargazers_url":"https://api.github.com/repos/jamonation/kuma/stargazers","contributors_url":"https://api.github.com/repos/jamonation/kuma/contributors","subscribers_url":"https://api.github.com/repos/jamonation/kuma/subscribers","subscription_url":"https://api.github.com/repos/jamonation/kuma/subscription","commits_url":"https://api.github.com/repos/jamonation/kuma/commits{/sha}","git_commits_url":"https://api.github.com/repos/jamonation/kuma/git/commits{/sha}","comments_url":"https://api.github.com/repos/jamonation/kuma/comments{/number}","issue_comment_url":"https://api.github.com/repos/jamonation/kuma/issues/comments{/number}","contents_url":"https://api.github.com/repos/jamonation/kuma/contents/{+path}","compare_url":"https://api.github.com/repos/jamonation/kuma/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jamonation/kuma/merges","archive_url":"https://api.github.com/repos/jamonation/kuma/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jamonation/kuma/downloads","issues_url":"https://api.github.com/repos/jamonation/kuma/issues{/number}","pulls_url":"https://api.github.com/repos/jamonation/kuma/pulls{/number}","milestones_url":"https://api.github.com/repos/jamonation/kuma/milestones{/number}","notifications_url":"https://api.github.com/repos/jamonation/kuma/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jamonation/kuma/labels{/name}","releases_url":"https://api.github.com/repos/jamonation/kuma/releases{/id}","created_at":"2014-07-08T01:45:59Z","updated_at":"2015-02-04T12:29:57Z","pushed_at":"2015-03-10T13:11:31Z","git_url":"git://github.com/jamonation/kuma.git","ssh_url":"git@github.com:jamonation/kuma.git","clone_url":"https://github.com/jamonation/kuma.git","svn_url":"https://github.com/jamonation/kuma","homepage":"https://developer.mozilla.org","size":78800,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"44bdc54a167498517bdbe3cf79491384c8fb0c63","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":1352520,"name":"kuma","full_name":"mozilla/kuma","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/kuma","description":"The Django project that powers MDN.","fork":false,"url":"https://api.github.com/repos/mozilla/kuma","forks_url":"https://api.github.com/repos/mozilla/kuma/forks","keys_url":"https://api.github.com/repos/mozilla/kuma/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/kuma/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/kuma/teams","hooks_url":"https://api.github.com/repos/mozilla/kuma/hooks","issue_events_url":"https://api.github.com/repos/mozilla/kuma/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/kuma/events","assignees_url":"https://api.github.com/repos/mozilla/kuma/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/kuma/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/kuma/tags","blobs_url":"https://api.github.com/repos/mozilla/kuma/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/kuma/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/kuma/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/kuma/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/kuma/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/kuma/languages","stargazers_url":"https://api.github.com/repos/mozilla/kuma/stargazers","contributors_url":"https://api.github.com/repos/mozilla/kuma/contributors","subscribers_url":"https://api.github.com/repos/mozilla/kuma/subscribers","subscription_url":"https://api.github.com/repos/mozilla/kuma/subscription","commits_url":"https://api.github.com/repos/mozilla/kuma/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/kuma/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/kuma/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/kuma/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/kuma/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/kuma/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/kuma/merges","archive_url":"https://api.github.com/repos/mozilla/kuma/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/kuma/downloads","issues_url":"https://api.github.com/repos/mozilla/kuma/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/kuma/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/kuma/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/kuma/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/kuma/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/kuma/releases{/id}","created_at":"2011-02-10T21:48:06Z","updated_at":"2015-03-11T11:58:15Z","pushed_at":"2015-03-11T11:58:12Z","git_url":"git://github.com/mozilla/kuma.git","ssh_url":"git@github.com:mozilla/kuma.git","clone_url":"https://github.com/mozilla/kuma.git","svn_url":"https://github.com/mozilla/kuma","homepage":"https://developer.mozilla.org","size":110103,"stargazers_count":550,"watchers_count":550,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":340,"mirror_url":null,"open_issues_count":13,"forks":340,"open_issues":13,"watchers":550,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/kuma/pulls/3104"},"html":{"href":"https://github.com/mozilla/kuma/pull/3104"},"issue":{"href":"https://api.github.com/repos/mozilla/kuma/issues/3104"},"comments":{"href":"https://api.github.com/repos/mozilla/kuma/issues/3104/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/kuma/pulls/3104/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/kuma/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/kuma/pulls/3104/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/kuma/statuses/64df468475b441b97bb937bb01d135e1dc4703fb"}}}}