{"action":"created","comment":{"url":"https://api.github.com/repos/juliancoleman/vigor-app/pulls/comments/64499303","id":64499303,"diff_hunk":"@@ -0,0 +1,61 @@\n+import json\n+from django.conf import settings\n+from django.contrib.auth import authenticate, login, logout\n+from django.contrib.auth.decorators import login_required\n+from django.contrib.auth.models import User\n+from django.core.urlresolvers import reverse\n+from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden\n+from django.shortcuts import get_object_or_404\n+from django.views.decorators.csrf import csrf_exempt\n+from .models import SystemMessage, UserPrefs\n+\n+def response_mimetype(req):\n+    if \"application/json\" in req.META['HTTP_ACCEPT']:\n+        return \"application/json\"\n+    else:\n+        return \"text/plain\"\n+\n+class JSONResponse(HttpResponse):\n+    \"\"\"JSON response class.\"\"\"\n+\n+    def __init__(self, obj=None, json_opts=None, mimetype=\"application/json\", *args, **kwargs):\n+        if obj is None:\n+            obj = {}\n+        if json_opts is None:\n+            json_opts = {}\n+        content = json.dumps(obj, **json_opts)\n+        super(JSONResponse, self).__init__(content, mimetype, *args, **kwargs)\n+\n+def sign_out(req):\n+    logout(req)\n+    # next = req.GET.get('next', None)\n+    # if next:\n+    #     return HttpResponseRedirect(next)\n+    # else:\n+    return HttpResponseRedirect(reverse('login'))\n+\n+@csrf_exempt\n+def register(req):\n+    if settings.REGISTER:\n+        if req.method == \"POST\":\n+            username = req.POST['username']\n+            password = req.POST['password']\n+            email = req.POST['email']\n+\n+            user = User.objects.create_user(username, email, password)\n+            UserPrefs.objects.create(user = user)\n+            user2 = authenticate(username = username, password = password)\n+            login(req, user2)","path":"vigor/ajax.py","position":44,"original_position":48,"commit_id":"b6a2a5052248153716091f73bf90a2a304b32d0e","original_commit_id":"ad1f58a6a1e978673d7e1ee5cecb66261eb0261a","user":{"login":"juliancoleman","id":11545939,"avatar_url":"https://avatars.githubusercontent.com/u/11545939?v=3","gravatar_id":"","url":"https://api.github.com/users/juliancoleman","html_url":"https://github.com/juliancoleman","followers_url":"https://api.github.com/users/juliancoleman/followers","following_url":"https://api.github.com/users/juliancoleman/following{/other_user}","gists_url":"https://api.github.com/users/juliancoleman/gists{/gist_id}","starred_url":"https://api.github.com/users/juliancoleman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juliancoleman/subscriptions","organizations_url":"https://api.github.com/users/juliancoleman/orgs","repos_url":"https://api.github.com/users/juliancoleman/repos","events_url":"https://api.github.com/users/juliancoleman/events{/privacy}","received_events_url":"https://api.github.com/users/juliancoleman/received_events","type":"User","site_admin":false},"body":"Waffle it is :D","created_at":"2016-05-25T00:41:11Z","updated_at":"2016-05-25T00:41:11Z","html_url":"https://github.com/juliancoleman/vigor-app/pull/10#discussion_r64499303","pull_request_url":"https://api.github.com/repos/juliancoleman/vigor-app/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/juliancoleman/vigor-app/pulls/comments/64499303"},"html":{"href":"https://github.com/juliancoleman/vigor-app/pull/10#discussion_r64499303"},"pull_request":{"href":"https://api.github.com/repos/juliancoleman/vigor-app/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/juliancoleman/vigor-app/pulls/10","id":70888437,"html_url":"https://github.com/juliancoleman/vigor-app/pull/10","diff_url":"https://github.com/juliancoleman/vigor-app/pull/10.diff","patch_url":"https://github.com/juliancoleman/vigor-app/pull/10.patch","issue_url":"https://api.github.com/repos/juliancoleman/vigor-app/issues/10","number":10,"state":"closed","locked":false,"title":"V1.0.0","user":{"login":"juliancoleman","id":11545939,"avatar_url":"https://avatars.githubusercontent.com/u/11545939?v=3","gravatar_id":"","url":"https://api.github.com/users/juliancoleman","html_url":"https://github.com/juliancoleman","followers_url":"https://api.github.com/users/juliancoleman/followers","following_url":"https://api.github.com/users/juliancoleman/following{/other_user}","gists_url":"https://api.github.com/users/juliancoleman/gists{/gist_id}","starred_url":"https://api.github.com/users/juliancoleman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juliancoleman/subscriptions","organizations_url":"https://api.github.com/users/juliancoleman/orgs","repos_url":"https://api.github.com/users/juliancoleman/repos","events_url":"https://api.github.com/users/juliancoleman/events{/privacy}","received_events_url":"https://api.github.com/users/juliancoleman/received_events","type":"User","site_admin":false},"body":"literally the fattest update, so yeah...","created_at":"2016-05-20T17:17:28Z","updated_at":"2016-05-25T00:41:11Z","closed_at":"2016-05-25T00:40:05Z","merged_at":"2016-05-25T00:40:05Z","merge_commit_sha":"c68af2e10e140d4fae55617c0f472c56901e7713","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/juliancoleman/vigor-app/pulls/10/commits","review_comments_url":"https://api.github.com/repos/juliancoleman/vigor-app/pulls/10/comments","review_comment_url":"https://api.github.com/repos/juliancoleman/vigor-app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/juliancoleman/vigor-app/issues/10/comments","statuses_url":"https://api.github.com/repos/juliancoleman/vigor-app/statuses/b6a2a5052248153716091f73bf90a2a304b32d0e","head":{"label":"juliancoleman:v1.0.0","ref":"v1.0.0","sha":"b6a2a5052248153716091f73bf90a2a304b32d0e","user":{"login":"juliancoleman","id":11545939,"avatar_url":"https://avatars.githubusercontent.com/u/11545939?v=3","gravatar_id":"","url":"https://api.github.com/users/juliancoleman","html_url":"https://github.com/juliancoleman","followers_url":"https://api.github.com/users/juliancoleman/followers","following_url":"https://api.github.com/users/juliancoleman/following{/other_user}","gists_url":"https://api.github.com/users/juliancoleman/gists{/gist_id}","starred_url":"https://api.github.com/users/juliancoleman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juliancoleman/subscriptions","organizations_url":"https://api.github.com/users/juliancoleman/orgs","repos_url":"https://api.github.com/users/juliancoleman/repos","events_url":"https://api.github.com/users/juliancoleman/events{/privacy}","received_events_url":"https://api.github.com/users/juliancoleman/received_events","type":"User","site_admin":false},"repo":{"id":57019835,"name":"vigor-app","full_name":"juliancoleman/vigor-app","owner":{"login":"juliancoleman","id":11545939,"avatar_url":"https://avatars.githubusercontent.com/u/11545939?v=3","gravatar_id":"","url":"https://api.github.com/users/juliancoleman","html_url":"https://github.com/juliancoleman","followers_url":"https://api.github.com/users/juliancoleman/followers","following_url":"https://api.github.com/users/juliancoleman/following{/other_user}","gists_url":"https://api.github.com/users/juliancoleman/gists{/gist_id}","starred_url":"https://api.github.com/users/juliancoleman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juliancoleman/subscriptions","organizations_url":"https://api.github.com/users/juliancoleman/orgs","repos_url":"https://api.github.com/users/juliancoleman/repos","events_url":"https://api.github.com/users/juliancoleman/events{/privacy}","received_events_url":"https://api.github.com/users/juliancoleman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/juliancoleman/vigor-app","description":"","fork":false,"url":"https://api.github.com/repos/juliancoleman/vigor-app","forks_url":"https://api.github.com/repos/juliancoleman/vigor-app/forks","keys_url":"https://api.github.com/repos/juliancoleman/vigor-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/juliancoleman/vigor-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/juliancoleman/vigor-app/teams","hooks_url":"https://api.github.com/repos/juliancoleman/vigor-app/hooks","issue_events_url":"https://api.github.com/repos/juliancoleman/vigor-app/issues/events{/number}","events_url":"https://api.github.com/repos/juliancoleman/vigor-app/events","assignees_url":"https://api.github.com/repos/juliancoleman/vigor-app/assignees{/user}","branches_url":"https://api.github.com/repos/juliancoleman/vigor-app/branches{/branch}","tags_url":"https://api.github.com/repos/juliancoleman/vigor-app/tags","blobs_url":"https://api.github.com/repos/juliancoleman/vigor-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/juliancoleman/vigor-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/juliancoleman/vigor-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/juliancoleman/vigor-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/juliancoleman/vigor-app/statuses/{sha}","languages_url":"https://api.github.com/repos/juliancoleman/vigor-app/languages","stargazers_url":"https://api.github.com/repos/juliancoleman/vigor-app/stargazers","contributors_url":"https://api.github.com/repos/juliancoleman/vigor-app/contributors","subscribers_url":"https://api.github.com/repos/juliancoleman/vigor-app/subscribers","subscription_url":"https://api.github.com/repos/juliancoleman/vigor-app/subscription","commits_url":"https://api.github.com/repos/juliancoleman/vigor-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/juliancoleman/vigor-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/juliancoleman/vigor-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/juliancoleman/vigor-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/juliancoleman/vigor-app/contents/{+path}","compare_url":"https://api.github.com/repos/juliancoleman/vigor-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/juliancoleman/vigor-app/merges","archive_url":"https://api.github.com/repos/juliancoleman/vigor-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/juliancoleman/vigor-app/downloads","issues_url":"https://api.github.com/repos/juliancoleman/vigor-app/issues{/number}","pulls_url":"https://api.github.com/repos/juliancoleman/vigor-app/pulls{/number}","milestones_url":"https://api.github.com/repos/juliancoleman/vigor-app/milestones{/number}","notifications_url":"https://api.github.com/repos/juliancoleman/vigor-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/juliancoleman/vigor-app/labels{/name}","releases_url":"https://api.github.com/repos/juliancoleman/vigor-app/releases{/id}","deployments_url":"https://api.github.com/repos/juliancoleman/vigor-app/deployments","created_at":"2016-04-25T07:15:25Z","updated_at":"2016-04-25T07:29:26Z","pushed_at":"2016-05-25T00:40:08Z","git_url":"git://github.com/juliancoleman/vigor-app.git","ssh_url":"git@github.com:juliancoleman/vigor-app.git","clone_url":"https://github.com/juliancoleman/vigor-app.git","svn_url":"https://github.com/juliancoleman/vigor-app","homepage":null,"size":2197,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"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":"juliancoleman:master","ref":"master","sha":"6c1f385c949755f55a217ce3a39cbc5772be3620","user":{"login":"juliancoleman","id":11545939,"avatar_url":"https://avatars.githubusercontent.com/u/11545939?v=3","gravatar_id":"","url":"https://api.github.com/users/juliancoleman","html_url":"https://github.com/juliancoleman","followers_url":"https://api.github.com/users/juliancoleman/followers","following_url":"https://api.github.com/users/juliancoleman/following{/other_user}","gists_url":"https://api.github.com/users/juliancoleman/gists{/gist_id}","starred_url":"https://api.github.com/users/juliancoleman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juliancoleman/subscriptions","organizations_url":"https://api.github.com/users/juliancoleman/orgs","repos_url":"https://api.github.com/users/juliancoleman/repos","events_url":"https://api.github.com/users/juliancoleman/events{/privacy}","received_events_url":"https://api.github.com/users/juliancoleman/received_events","type":"User","site_admin":false},"repo":{"id":57019835,"name":"vigor-app","full_name":"juliancoleman/vigor-app","owner":{"login":"juliancoleman","id":11545939,"avatar_url":"https://avatars.githubusercontent.com/u/11545939?v=3","gravatar_id":"","url":"https://api.github.com/users/juliancoleman","html_url":"https://github.com/juliancoleman","followers_url":"https://api.github.com/users/juliancoleman/followers","following_url":"https://api.github.com/users/juliancoleman/following{/other_user}","gists_url":"https://api.github.com/users/juliancoleman/gists{/gist_id}","starred_url":"https://api.github.com/users/juliancoleman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juliancoleman/subscriptions","organizations_url":"https://api.github.com/users/juliancoleman/orgs","repos_url":"https://api.github.com/users/juliancoleman/repos","events_url":"https://api.github.com/users/juliancoleman/events{/privacy}","received_events_url":"https://api.github.com/users/juliancoleman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/juliancoleman/vigor-app","description":"","fork":false,"url":"https://api.github.com/repos/juliancoleman/vigor-app","forks_url":"https://api.github.com/repos/juliancoleman/vigor-app/forks","keys_url":"https://api.github.com/repos/juliancoleman/vigor-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/juliancoleman/vigor-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/juliancoleman/vigor-app/teams","hooks_url":"https://api.github.com/repos/juliancoleman/vigor-app/hooks","issue_events_url":"https://api.github.com/repos/juliancoleman/vigor-app/issues/events{/number}","events_url":"https://api.github.com/repos/juliancoleman/vigor-app/events","assignees_url":"https://api.github.com/repos/juliancoleman/vigor-app/assignees{/user}","branches_url":"https://api.github.com/repos/juliancoleman/vigor-app/branches{/branch}","tags_url":"https://api.github.com/repos/juliancoleman/vigor-app/tags","blobs_url":"https://api.github.com/repos/juliancoleman/vigor-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/juliancoleman/vigor-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/juliancoleman/vigor-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/juliancoleman/vigor-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/juliancoleman/vigor-app/statuses/{sha}","languages_url":"https://api.github.com/repos/juliancoleman/vigor-app/languages","stargazers_url":"https://api.github.com/repos/juliancoleman/vigor-app/stargazers","contributors_url":"https://api.github.com/repos/juliancoleman/vigor-app/contributors","subscribers_url":"https://api.github.com/repos/juliancoleman/vigor-app/subscribers","subscription_url":"https://api.github.com/repos/juliancoleman/vigor-app/subscription","commits_url":"https://api.github.com/repos/juliancoleman/vigor-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/juliancoleman/vigor-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/juliancoleman/vigor-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/juliancoleman/vigor-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/juliancoleman/vigor-app/contents/{+path}","compare_url":"https://api.github.com/repos/juliancoleman/vigor-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/juliancoleman/vigor-app/merges","archive_url":"https://api.github.com/repos/juliancoleman/vigor-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/juliancoleman/vigor-app/downloads","issues_url":"https://api.github.com/repos/juliancoleman/vigor-app/issues{/number}","pulls_url":"https://api.github.com/repos/juliancoleman/vigor-app/pulls{/number}","milestones_url":"https://api.github.com/repos/juliancoleman/vigor-app/milestones{/number}","notifications_url":"https://api.github.com/repos/juliancoleman/vigor-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/juliancoleman/vigor-app/labels{/name}","releases_url":"https://api.github.com/repos/juliancoleman/vigor-app/releases{/id}","deployments_url":"https://api.github.com/repos/juliancoleman/vigor-app/deployments","created_at":"2016-04-25T07:15:25Z","updated_at":"2016-04-25T07:29:26Z","pushed_at":"2016-05-25T00:40:08Z","git_url":"git://github.com/juliancoleman/vigor-app.git","ssh_url":"git@github.com:juliancoleman/vigor-app.git","clone_url":"https://github.com/juliancoleman/vigor-app.git","svn_url":"https://github.com/juliancoleman/vigor-app","homepage":null,"size":2197,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"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"}},"_links":{"self":{"href":"https://api.github.com/repos/juliancoleman/vigor-app/pulls/10"},"html":{"href":"https://github.com/juliancoleman/vigor-app/pull/10"},"issue":{"href":"https://api.github.com/repos/juliancoleman/vigor-app/issues/10"},"comments":{"href":"https://api.github.com/repos/juliancoleman/vigor-app/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/juliancoleman/vigor-app/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/juliancoleman/vigor-app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/juliancoleman/vigor-app/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/juliancoleman/vigor-app/statuses/b6a2a5052248153716091f73bf90a2a304b32d0e"}}}}
{"actor":{"display_login":"juliancoleman"}}