{"action":"created","comment":{"url":"https://api.github.com/repos/emory-libraries/django-eultheme/pulls/comments/32955829","id":32955829,"diff_hunk":"@@ -0,0 +1,23 @@\n+from django.conf import settings\n+from django.shortcuts import render\n+from downtime.middleware import DowntimeMiddleware\n+\n+class DownpageMiddleware(DowntimeMiddleware):\n+\n+    def process_request(self, request):\n+        def get_client_ip(request):\n+            x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR')\n+            if x_forwarded_for:\n+                ip = x_forwarded_for.split(',')[0]\n+            else:\n+                ip = request.META.get('REMOTE_ADDR')\n+            return ip\n+\n+        downtime_request = super(DownpageMiddleware,self).process_request(request)\n+\n+        if downtime_request and \\\n+            settings.DOWNTIME_ALLOWED_IPS and \\","path":"eultheme/middleware.py","position":19,"original_position":19,"commit_id":"c364812215de33c0725a0814136309e927257f8f","original_commit_id":"c364812215de33c0725a0814136309e927257f8f","user":{"login":"rlskoeser","id":691231,"avatar_url":"https://avatars.githubusercontent.com/u/691231?v=3","gravatar_id":"","url":"https://api.github.com/users/rlskoeser","html_url":"https://github.com/rlskoeser","followers_url":"https://api.github.com/users/rlskoeser/followers","following_url":"https://api.github.com/users/rlskoeser/following{/other_user}","gists_url":"https://api.github.com/users/rlskoeser/gists{/gist_id}","starred_url":"https://api.github.com/users/rlskoeser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rlskoeser/subscriptions","organizations_url":"https://api.github.com/users/rlskoeser/orgs","repos_url":"https://api.github.com/users/rlskoeser/repos","events_url":"https://api.github.com/users/rlskoeser/events{/privacy}","received_events_url":"https://api.github.com/users/rlskoeser/received_events","type":"User","site_admin":false},"body":"Recommend using ```getattr(settings, 'DOWNTIME_ALLOWED_IPS', [])``` (or something like that) here so that the middleware doesn't break if no IPs are configured.","created_at":"2015-06-22T16:49:11Z","updated_at":"2015-06-22T16:49:11Z","html_url":"https://github.com/emory-libraries/django-eultheme/pull/1#discussion_r32955829","pull_request_url":"https://api.github.com/repos/emory-libraries/django-eultheme/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/emory-libraries/django-eultheme/pulls/comments/32955829"},"html":{"href":"https://github.com/emory-libraries/django-eultheme/pull/1#discussion_r32955829"},"pull_request":{"href":"https://api.github.com/repos/emory-libraries/django-eultheme/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/emory-libraries/django-eultheme/pulls/1","id":38244837,"html_url":"https://github.com/emory-libraries/django-eultheme/pull/1","diff_url":"https://github.com/emory-libraries/django-eultheme/pull/1.diff","patch_url":"https://github.com/emory-libraries/django-eultheme/pull/1.patch","issue_url":"https://api.github.com/repos/emory-libraries/django-eultheme/issues/1","number":1,"state":"open","locked":false,"title":"Feature/maintenance notifications","user":{"login":"kevinglover","id":2983582,"avatar_url":"https://avatars.githubusercontent.com/u/2983582?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinglover","html_url":"https://github.com/kevinglover","followers_url":"https://api.github.com/users/kevinglover/followers","following_url":"https://api.github.com/users/kevinglover/following{/other_user}","gists_url":"https://api.github.com/users/kevinglover/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinglover/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinglover/subscriptions","organizations_url":"https://api.github.com/users/kevinglover/orgs","repos_url":"https://api.github.com/users/kevinglover/repos","events_url":"https://api.github.com/users/kevinglover/events{/privacy}","received_events_url":"https://api.github.com/users/kevinglover/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-22T15:37:09Z","updated_at":"2015-06-22T16:49:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f1406ce5eda9190c894ab03b6820d111b33b87cd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/emory-libraries/django-eultheme/pulls/1/commits","review_comments_url":"https://api.github.com/repos/emory-libraries/django-eultheme/pulls/1/comments","review_comment_url":"https://api.github.com/repos/emory-libraries/django-eultheme/pulls/comments{/number}","comments_url":"https://api.github.com/repos/emory-libraries/django-eultheme/issues/1/comments","statuses_url":"https://api.github.com/repos/emory-libraries/django-eultheme/statuses/c364812215de33c0725a0814136309e927257f8f","head":{"label":"emory-libraries:feature/maintenance_notifications","ref":"feature/maintenance_notifications","sha":"c364812215de33c0725a0814136309e927257f8f","user":{"login":"emory-libraries","id":786460,"avatar_url":"https://avatars.githubusercontent.com/u/786460?v=3","gravatar_id":"","url":"https://api.github.com/users/emory-libraries","html_url":"https://github.com/emory-libraries","followers_url":"https://api.github.com/users/emory-libraries/followers","following_url":"https://api.github.com/users/emory-libraries/following{/other_user}","gists_url":"https://api.github.com/users/emory-libraries/gists{/gist_id}","starred_url":"https://api.github.com/users/emory-libraries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emory-libraries/subscriptions","organizations_url":"https://api.github.com/users/emory-libraries/orgs","repos_url":"https://api.github.com/users/emory-libraries/repos","events_url":"https://api.github.com/users/emory-libraries/events{/privacy}","received_events_url":"https://api.github.com/users/emory-libraries/received_events","type":"Organization","site_admin":false},"repo":{"id":15238273,"name":"django-eultheme","full_name":"emory-libraries/django-eultheme","owner":{"login":"emory-libraries","id":786460,"avatar_url":"https://avatars.githubusercontent.com/u/786460?v=3","gravatar_id":"","url":"https://api.github.com/users/emory-libraries","html_url":"https://github.com/emory-libraries","followers_url":"https://api.github.com/users/emory-libraries/followers","following_url":"https://api.github.com/users/emory-libraries/following{/other_user}","gists_url":"https://api.github.com/users/emory-libraries/gists{/gist_id}","starred_url":"https://api.github.com/users/emory-libraries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emory-libraries/subscriptions","organizations_url":"https://api.github.com/users/emory-libraries/orgs","repos_url":"https://api.github.com/users/emory-libraries/repos","events_url":"https://api.github.com/users/emory-libraries/events{/privacy}","received_events_url":"https://api.github.com/users/emory-libraries/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/emory-libraries/django-eultheme","description":"Reusable Emory University Libraries theme/templates for use with Django applications","fork":false,"url":"https://api.github.com/repos/emory-libraries/django-eultheme","forks_url":"https://api.github.com/repos/emory-libraries/django-eultheme/forks","keys_url":"https://api.github.com/repos/emory-libraries/django-eultheme/keys{/key_id}","collaborators_url":"https://api.github.com/repos/emory-libraries/django-eultheme/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/emory-libraries/django-eultheme/teams","hooks_url":"https://api.github.com/repos/emory-libraries/django-eultheme/hooks","issue_events_url":"https://api.github.com/repos/emory-libraries/django-eultheme/issues/events{/number}","events_url":"https://api.github.com/repos/emory-libraries/django-eultheme/events","assignees_url":"https://api.github.com/repos/emory-libraries/django-eultheme/assignees{/user}","branches_url":"https://api.github.com/repos/emory-libraries/django-eultheme/branches{/branch}","tags_url":"https://api.github.com/repos/emory-libraries/django-eultheme/tags","blobs_url":"https://api.github.com/repos/emory-libraries/django-eultheme/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/emory-libraries/django-eultheme/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/emory-libraries/django-eultheme/git/refs{/sha}","trees_url":"https://api.github.com/repos/emory-libraries/django-eultheme/git/trees{/sha}","statuses_url":"https://api.github.com/repos/emory-libraries/django-eultheme/statuses/{sha}","languages_url":"https://api.github.com/repos/emory-libraries/django-eultheme/languages","stargazers_url":"https://api.github.com/repos/emory-libraries/django-eultheme/stargazers","contributors_url":"https://api.github.com/repos/emory-libraries/django-eultheme/contributors","subscribers_url":"https://api.github.com/repos/emory-libraries/django-eultheme/subscribers","subscription_url":"https://api.github.com/repos/emory-libraries/django-eultheme/subscription","commits_url":"https://api.github.com/repos/emory-libraries/django-eultheme/commits{/sha}","git_commits_url":"https://api.github.com/repos/emory-libraries/django-eultheme/git/commits{/sha}","comments_url":"https://api.github.com/repos/emory-libraries/django-eultheme/comments{/number}","issue_comment_url":"https://api.github.com/repos/emory-libraries/django-eultheme/issues/comments{/number}","contents_url":"https://api.github.com/repos/emory-libraries/django-eultheme/contents/{+path}","compare_url":"https://api.github.com/repos/emory-libraries/django-eultheme/compare/{base}...{head}","merges_url":"https://api.github.com/repos/emory-libraries/django-eultheme/merges","archive_url":"https://api.github.com/repos/emory-libraries/django-eultheme/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/emory-libraries/django-eultheme/downloads","issues_url":"https://api.github.com/repos/emory-libraries/django-eultheme/issues{/number}","pulls_url":"https://api.github.com/repos/emory-libraries/django-eultheme/pulls{/number}","milestones_url":"https://api.github.com/repos/emory-libraries/django-eultheme/milestones{/number}","notifications_url":"https://api.github.com/repos/emory-libraries/django-eultheme/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/emory-libraries/django-eultheme/labels{/name}","releases_url":"https://api.github.com/repos/emory-libraries/django-eultheme/releases{/id}","created_at":"2013-12-16T21:53:46Z","updated_at":"2014-09-04T17:45:01Z","pushed_at":"2015-06-22T15:37:10Z","git_url":"git://github.com/emory-libraries/django-eultheme.git","ssh_url":"git@github.com:emory-libraries/django-eultheme.git","clone_url":"https://github.com/emory-libraries/django-eultheme.git","svn_url":"https://github.com/emory-libraries/django-eultheme","homepage":null,"size":1100,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"emory-libraries:master","ref":"master","sha":"4cf90fec8bfe9bf524f76a0d0b91e09f24527928","user":{"login":"emory-libraries","id":786460,"avatar_url":"https://avatars.githubusercontent.com/u/786460?v=3","gravatar_id":"","url":"https://api.github.com/users/emory-libraries","html_url":"https://github.com/emory-libraries","followers_url":"https://api.github.com/users/emory-libraries/followers","following_url":"https://api.github.com/users/emory-libraries/following{/other_user}","gists_url":"https://api.github.com/users/emory-libraries/gists{/gist_id}","starred_url":"https://api.github.com/users/emory-libraries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emory-libraries/subscriptions","organizations_url":"https://api.github.com/users/emory-libraries/orgs","repos_url":"https://api.github.com/users/emory-libraries/repos","events_url":"https://api.github.com/users/emory-libraries/events{/privacy}","received_events_url":"https://api.github.com/users/emory-libraries/received_events","type":"Organization","site_admin":false},"repo":{"id":15238273,"name":"django-eultheme","full_name":"emory-libraries/django-eultheme","owner":{"login":"emory-libraries","id":786460,"avatar_url":"https://avatars.githubusercontent.com/u/786460?v=3","gravatar_id":"","url":"https://api.github.com/users/emory-libraries","html_url":"https://github.com/emory-libraries","followers_url":"https://api.github.com/users/emory-libraries/followers","following_url":"https://api.github.com/users/emory-libraries/following{/other_user}","gists_url":"https://api.github.com/users/emory-libraries/gists{/gist_id}","starred_url":"https://api.github.com/users/emory-libraries/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emory-libraries/subscriptions","organizations_url":"https://api.github.com/users/emory-libraries/orgs","repos_url":"https://api.github.com/users/emory-libraries/repos","events_url":"https://api.github.com/users/emory-libraries/events{/privacy}","received_events_url":"https://api.github.com/users/emory-libraries/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/emory-libraries/django-eultheme","description":"Reusable Emory University Libraries theme/templates for use with Django applications","fork":false,"url":"https://api.github.com/repos/emory-libraries/django-eultheme","forks_url":"https://api.github.com/repos/emory-libraries/django-eultheme/forks","keys_url":"https://api.github.com/repos/emory-libraries/django-eultheme/keys{/key_id}","collaborators_url":"https://api.github.com/repos/emory-libraries/django-eultheme/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/emory-libraries/django-eultheme/teams","hooks_url":"https://api.github.com/repos/emory-libraries/django-eultheme/hooks","issue_events_url":"https://api.github.com/repos/emory-libraries/django-eultheme/issues/events{/number}","events_url":"https://api.github.com/repos/emory-libraries/django-eultheme/events","assignees_url":"https://api.github.com/repos/emory-libraries/django-eultheme/assignees{/user}","branches_url":"https://api.github.com/repos/emory-libraries/django-eultheme/branches{/branch}","tags_url":"https://api.github.com/repos/emory-libraries/django-eultheme/tags","blobs_url":"https://api.github.com/repos/emory-libraries/django-eultheme/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/emory-libraries/django-eultheme/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/emory-libraries/django-eultheme/git/refs{/sha}","trees_url":"https://api.github.com/repos/emory-libraries/django-eultheme/git/trees{/sha}","statuses_url":"https://api.github.com/repos/emory-libraries/django-eultheme/statuses/{sha}","languages_url":"https://api.github.com/repos/emory-libraries/django-eultheme/languages","stargazers_url":"https://api.github.com/repos/emory-libraries/django-eultheme/stargazers","contributors_url":"https://api.github.com/repos/emory-libraries/django-eultheme/contributors","subscribers_url":"https://api.github.com/repos/emory-libraries/django-eultheme/subscribers","subscription_url":"https://api.github.com/repos/emory-libraries/django-eultheme/subscription","commits_url":"https://api.github.com/repos/emory-libraries/django-eultheme/commits{/sha}","git_commits_url":"https://api.github.com/repos/emory-libraries/django-eultheme/git/commits{/sha}","comments_url":"https://api.github.com/repos/emory-libraries/django-eultheme/comments{/number}","issue_comment_url":"https://api.github.com/repos/emory-libraries/django-eultheme/issues/comments{/number}","contents_url":"https://api.github.com/repos/emory-libraries/django-eultheme/contents/{+path}","compare_url":"https://api.github.com/repos/emory-libraries/django-eultheme/compare/{base}...{head}","merges_url":"https://api.github.com/repos/emory-libraries/django-eultheme/merges","archive_url":"https://api.github.com/repos/emory-libraries/django-eultheme/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/emory-libraries/django-eultheme/downloads","issues_url":"https://api.github.com/repos/emory-libraries/django-eultheme/issues{/number}","pulls_url":"https://api.github.com/repos/emory-libraries/django-eultheme/pulls{/number}","milestones_url":"https://api.github.com/repos/emory-libraries/django-eultheme/milestones{/number}","notifications_url":"https://api.github.com/repos/emory-libraries/django-eultheme/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/emory-libraries/django-eultheme/labels{/name}","releases_url":"https://api.github.com/repos/emory-libraries/django-eultheme/releases{/id}","created_at":"2013-12-16T21:53:46Z","updated_at":"2014-09-04T17:45:01Z","pushed_at":"2015-06-22T15:37:10Z","git_url":"git://github.com/emory-libraries/django-eultheme.git","ssh_url":"git@github.com:emory-libraries/django-eultheme.git","clone_url":"https://github.com/emory-libraries/django-eultheme.git","svn_url":"https://github.com/emory-libraries/django-eultheme","homepage":null,"size":1100,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/emory-libraries/django-eultheme/pulls/1"},"html":{"href":"https://github.com/emory-libraries/django-eultheme/pull/1"},"issue":{"href":"https://api.github.com/repos/emory-libraries/django-eultheme/issues/1"},"comments":{"href":"https://api.github.com/repos/emory-libraries/django-eultheme/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/emory-libraries/django-eultheme/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/emory-libraries/django-eultheme/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/emory-libraries/django-eultheme/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/emory-libraries/django-eultheme/statuses/c364812215de33c0725a0814136309e927257f8f"}}}}