{"action":"created","comment":{"url":"https://api.github.com/repos/18F/forest-service-prototype/pulls/comments/80769952","pull_request_review_id":1802304,"id":80769952,"diff_hunk":"@@ -1,21 +1,56 @@\n from django.contrib.auth.decorators import login_required\n from django.shortcuts import render, redirect, get_object_or_404\n from django.http import HttpResponse\n+from django.forms.models import model_to_dict\n from .forms import PermitForm\n from .models import Permit\n+import logging\n \n # Create your views here.\n+logger = logging.getLogger(__name__)\n \n-def submit(request):\n-    form = PermitForm(request.POST or None)\n-    if form.is_valid():\n-        permit = form.save()\n-        # send_report_notification(request, permit)\n-        return redirect(submitted_permit)\n-    return render(request, \"specialuseform/submit.html\", {'form': form})\n \n-def submitted_permit(request):\n-    return render(request, \"specialuseform/submitted_permit.html\")\n+# def submit(request):\n+#     form = PermitForm(request.POST or None)\n+#     if form.is_valid():\n+#         permit = form.save()\n+#         # send_report_notification(request, permit)\n+#         return redirect(submitted_permit, permit_id = permit.permit_id)\n+#     return render(request, \"specialuseform/submit.html\", {'form': form})\n+\n+def submit(request, permit_id=None, template_name='specialuseform/submit.html'):\n+    if permit_id:\n+        permit = get_object_or_404(Permit, permit_id=permit_id)\n+        submit_button_text = 'Save Changes'\n+    else:\n+        permit = Permit()\n+        submit_button_text = 'Submit Your Application'\n+\n+    form = PermitForm(request.POST or None, instance=permit)\n+    if request.POST and form.is_valid():\n+        form.save()\n+\n+        # Save was successful, so redirect to another page\n+        # return redirect(submitted_permit, permit.permit_id)\n+        return redirect(submitted_permit, form.instance.permit_id)\n+\n+    return render(request, template_name, {\n+        'form': form, 'submit_text': submit_button_text\n+    })\n+\n+def submitted_permit(request, permit_id):\n+    # logger.error(permit_id)\n+    permit = get_object_or_404(Permit.objects.filter(permit_id=permit_id))\n+    # permit_dict = model_to_dict(permit)","path":"forestserviceprototype/specialuseform/views.py","position":53,"original_position":53,"commit_id":"851721646f15f58948241a290fffa18bed4ebb27","original_commit_id":"851721646f15f58948241a290fffa18bed4ebb27","user":{"login":"fureigh","id":1244599,"avatar_url":"https://avatars.githubusercontent.com/u/1244599?v=3","gravatar_id":"","url":"https://api.github.com/users/fureigh","html_url":"https://github.com/fureigh","followers_url":"https://api.github.com/users/fureigh/followers","following_url":"https://api.github.com/users/fureigh/following{/other_user}","gists_url":"https://api.github.com/users/fureigh/gists{/gist_id}","starred_url":"https://api.github.com/users/fureigh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fureigh/subscriptions","organizations_url":"https://api.github.com/users/fureigh/orgs","repos_url":"https://api.github.com/users/fureigh/repos","events_url":"https://api.github.com/users/fureigh/events{/privacy}","received_events_url":"https://api.github.com/users/fureigh/received_events","type":"User","site_admin":false},"body":"Lines 42 and 44 can be removed, yes?","created_at":"2016-09-27T19:03:27Z","updated_at":"2016-09-27T19:03:27Z","html_url":"https://github.com/18F/forest-service-prototype/pull/17#discussion_r80769952","pull_request_url":"https://api.github.com/repos/18F/forest-service-prototype/pulls/17","_links":{"self":{"href":"https://api.github.com/repos/18F/forest-service-prototype/pulls/comments/80769952"},"html":{"href":"https://github.com/18F/forest-service-prototype/pull/17#discussion_r80769952"},"pull_request":{"href":"https://api.github.com/repos/18F/forest-service-prototype/pulls/17"}}},"pull_request":{"url":"https://api.github.com/repos/18F/forest-service-prototype/pulls/17","id":86794980,"html_url":"https://github.com/18F/forest-service-prototype/pull/17","diff_url":"https://github.com/18F/forest-service-prototype/pull/17.diff","patch_url":"https://github.com/18F/forest-service-prototype/pull/17.patch","issue_url":"https://api.github.com/repos/18F/forest-service-prototype/issues/17","number":17,"state":"open","locked":false,"title":"Confirmation page and application cancellation","user":{"login":"lauraGgit","id":5840989,"avatar_url":"https://avatars.githubusercontent.com/u/5840989?v=3","gravatar_id":"","url":"https://api.github.com/users/lauraGgit","html_url":"https://github.com/lauraGgit","followers_url":"https://api.github.com/users/lauraGgit/followers","following_url":"https://api.github.com/users/lauraGgit/following{/other_user}","gists_url":"https://api.github.com/users/lauraGgit/gists{/gist_id}","starred_url":"https://api.github.com/users/lauraGgit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lauraGgit/subscriptions","organizations_url":"https://api.github.com/users/lauraGgit/orgs","repos_url":"https://api.github.com/users/lauraGgit/repos","events_url":"https://api.github.com/users/lauraGgit/events{/privacy}","received_events_url":"https://api.github.com/users/lauraGgit/received_events","type":"User","site_admin":false},"body":"Creating a confirmation page for submitters to close #13, close #11, and close #5.","created_at":"2016-09-26T18:34:08Z","updated_at":"2016-09-27T19:03:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c9de7b1e1b5166b3a49f879be6cdd52ee303d488","assignee":{"login":"fureigh","id":1244599,"avatar_url":"https://avatars.githubusercontent.com/u/1244599?v=3","gravatar_id":"","url":"https://api.github.com/users/fureigh","html_url":"https://github.com/fureigh","followers_url":"https://api.github.com/users/fureigh/followers","following_url":"https://api.github.com/users/fureigh/following{/other_user}","gists_url":"https://api.github.com/users/fureigh/gists{/gist_id}","starred_url":"https://api.github.com/users/fureigh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fureigh/subscriptions","organizations_url":"https://api.github.com/users/fureigh/orgs","repos_url":"https://api.github.com/users/fureigh/repos","events_url":"https://api.github.com/users/fureigh/events{/privacy}","received_events_url":"https://api.github.com/users/fureigh/received_events","type":"User","site_admin":false},"assignees":[{"login":"fureigh","id":1244599,"avatar_url":"https://avatars.githubusercontent.com/u/1244599?v=3","gravatar_id":"","url":"https://api.github.com/users/fureigh","html_url":"https://github.com/fureigh","followers_url":"https://api.github.com/users/fureigh/followers","following_url":"https://api.github.com/users/fureigh/following{/other_user}","gists_url":"https://api.github.com/users/fureigh/gists{/gist_id}","starred_url":"https://api.github.com/users/fureigh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fureigh/subscriptions","organizations_url":"https://api.github.com/users/fureigh/orgs","repos_url":"https://api.github.com/users/fureigh/repos","events_url":"https://api.github.com/users/fureigh/events{/privacy}","received_events_url":"https://api.github.com/users/fureigh/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/18F/forest-service-prototype/pulls/17/commits","review_comments_url":"https://api.github.com/repos/18F/forest-service-prototype/pulls/17/comments","review_comment_url":"https://api.github.com/repos/18F/forest-service-prototype/pulls/comments{/number}","comments_url":"https://api.github.com/repos/18F/forest-service-prototype/issues/17/comments","statuses_url":"https://api.github.com/repos/18F/forest-service-prototype/statuses/851721646f15f58948241a290fffa18bed4ebb27","head":{"label":"18F:confirmation-page","ref":"confirmation-page","sha":"851721646f15f58948241a290fffa18bed4ebb27","user":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"repo":{"id":68835067,"name":"forest-service-prototype","full_name":"18F/forest-service-prototype","owner":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/18F/forest-service-prototype","description":null,"fork":false,"url":"https://api.github.com/repos/18F/forest-service-prototype","forks_url":"https://api.github.com/repos/18F/forest-service-prototype/forks","keys_url":"https://api.github.com/repos/18F/forest-service-prototype/keys{/key_id}","collaborators_url":"https://api.github.com/repos/18F/forest-service-prototype/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/18F/forest-service-prototype/teams","hooks_url":"https://api.github.com/repos/18F/forest-service-prototype/hooks","issue_events_url":"https://api.github.com/repos/18F/forest-service-prototype/issues/events{/number}","events_url":"https://api.github.com/repos/18F/forest-service-prototype/events","assignees_url":"https://api.github.com/repos/18F/forest-service-prototype/assignees{/user}","branches_url":"https://api.github.com/repos/18F/forest-service-prototype/branches{/branch}","tags_url":"https://api.github.com/repos/18F/forest-service-prototype/tags","blobs_url":"https://api.github.com/repos/18F/forest-service-prototype/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/18F/forest-service-prototype/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/18F/forest-service-prototype/git/refs{/sha}","trees_url":"https://api.github.com/repos/18F/forest-service-prototype/git/trees{/sha}","statuses_url":"https://api.github.com/repos/18F/forest-service-prototype/statuses/{sha}","languages_url":"https://api.github.com/repos/18F/forest-service-prototype/languages","stargazers_url":"https://api.github.com/repos/18F/forest-service-prototype/stargazers","contributors_url":"https://api.github.com/repos/18F/forest-service-prototype/contributors","subscribers_url":"https://api.github.com/repos/18F/forest-service-prototype/subscribers","subscription_url":"https://api.github.com/repos/18F/forest-service-prototype/subscription","commits_url":"https://api.github.com/repos/18F/forest-service-prototype/commits{/sha}","git_commits_url":"https://api.github.com/repos/18F/forest-service-prototype/git/commits{/sha}","comments_url":"https://api.github.com/repos/18F/forest-service-prototype/comments{/number}","issue_comment_url":"https://api.github.com/repos/18F/forest-service-prototype/issues/comments{/number}","contents_url":"https://api.github.com/repos/18F/forest-service-prototype/contents/{+path}","compare_url":"https://api.github.com/repos/18F/forest-service-prototype/compare/{base}...{head}","merges_url":"https://api.github.com/repos/18F/forest-service-prototype/merges","archive_url":"https://api.github.com/repos/18F/forest-service-prototype/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/18F/forest-service-prototype/downloads","issues_url":"https://api.github.com/repos/18F/forest-service-prototype/issues{/number}","pulls_url":"https://api.github.com/repos/18F/forest-service-prototype/pulls{/number}","milestones_url":"https://api.github.com/repos/18F/forest-service-prototype/milestones{/number}","notifications_url":"https://api.github.com/repos/18F/forest-service-prototype/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/18F/forest-service-prototype/labels{/name}","releases_url":"https://api.github.com/repos/18F/forest-service-prototype/releases{/id}","deployments_url":"https://api.github.com/repos/18F/forest-service-prototype/deployments","created_at":"2016-09-21T16:13:39Z","updated_at":"2016-09-26T17:36:37Z","pushed_at":"2016-09-27T16:55:12Z","git_url":"git://github.com/18F/forest-service-prototype.git","ssh_url":"git@github.com:18F/forest-service-prototype.git","clone_url":"https://github.com/18F/forest-service-prototype.git","svn_url":"https://github.com/18F/forest-service-prototype","homepage":null,"size":1080,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":19,"forks":1,"open_issues":19,"watchers":3,"default_branch":"master"}},"base":{"label":"18F:master","ref":"master","sha":"c101c5a2a340aa9dffc5374b6a1cddee150e4439","user":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"repo":{"id":68835067,"name":"forest-service-prototype","full_name":"18F/forest-service-prototype","owner":{"login":"18F","id":6233994,"avatar_url":"https://avatars.githubusercontent.com/u/6233994?v=3","gravatar_id":"","url":"https://api.github.com/users/18F","html_url":"https://github.com/18F","followers_url":"https://api.github.com/users/18F/followers","following_url":"https://api.github.com/users/18F/following{/other_user}","gists_url":"https://api.github.com/users/18F/gists{/gist_id}","starred_url":"https://api.github.com/users/18F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/18F/subscriptions","organizations_url":"https://api.github.com/users/18F/orgs","repos_url":"https://api.github.com/users/18F/repos","events_url":"https://api.github.com/users/18F/events{/privacy}","received_events_url":"https://api.github.com/users/18F/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/18F/forest-service-prototype","description":null,"fork":false,"url":"https://api.github.com/repos/18F/forest-service-prototype","forks_url":"https://api.github.com/repos/18F/forest-service-prototype/forks","keys_url":"https://api.github.com/repos/18F/forest-service-prototype/keys{/key_id}","collaborators_url":"https://api.github.com/repos/18F/forest-service-prototype/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/18F/forest-service-prototype/teams","hooks_url":"https://api.github.com/repos/18F/forest-service-prototype/hooks","issue_events_url":"https://api.github.com/repos/18F/forest-service-prototype/issues/events{/number}","events_url":"https://api.github.com/repos/18F/forest-service-prototype/events","assignees_url":"https://api.github.com/repos/18F/forest-service-prototype/assignees{/user}","branches_url":"https://api.github.com/repos/18F/forest-service-prototype/branches{/branch}","tags_url":"https://api.github.com/repos/18F/forest-service-prototype/tags","blobs_url":"https://api.github.com/repos/18F/forest-service-prototype/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/18F/forest-service-prototype/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/18F/forest-service-prototype/git/refs{/sha}","trees_url":"https://api.github.com/repos/18F/forest-service-prototype/git/trees{/sha}","statuses_url":"https://api.github.com/repos/18F/forest-service-prototype/statuses/{sha}","languages_url":"https://api.github.com/repos/18F/forest-service-prototype/languages","stargazers_url":"https://api.github.com/repos/18F/forest-service-prototype/stargazers","contributors_url":"https://api.github.com/repos/18F/forest-service-prototype/contributors","subscribers_url":"https://api.github.com/repos/18F/forest-service-prototype/subscribers","subscription_url":"https://api.github.com/repos/18F/forest-service-prototype/subscription","commits_url":"https://api.github.com/repos/18F/forest-service-prototype/commits{/sha}","git_commits_url":"https://api.github.com/repos/18F/forest-service-prototype/git/commits{/sha}","comments_url":"https://api.github.com/repos/18F/forest-service-prototype/comments{/number}","issue_comment_url":"https://api.github.com/repos/18F/forest-service-prototype/issues/comments{/number}","contents_url":"https://api.github.com/repos/18F/forest-service-prototype/contents/{+path}","compare_url":"https://api.github.com/repos/18F/forest-service-prototype/compare/{base}...{head}","merges_url":"https://api.github.com/repos/18F/forest-service-prototype/merges","archive_url":"https://api.github.com/repos/18F/forest-service-prototype/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/18F/forest-service-prototype/downloads","issues_url":"https://api.github.com/repos/18F/forest-service-prototype/issues{/number}","pulls_url":"https://api.github.com/repos/18F/forest-service-prototype/pulls{/number}","milestones_url":"https://api.github.com/repos/18F/forest-service-prototype/milestones{/number}","notifications_url":"https://api.github.com/repos/18F/forest-service-prototype/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/18F/forest-service-prototype/labels{/name}","releases_url":"https://api.github.com/repos/18F/forest-service-prototype/releases{/id}","deployments_url":"https://api.github.com/repos/18F/forest-service-prototype/deployments","created_at":"2016-09-21T16:13:39Z","updated_at":"2016-09-26T17:36:37Z","pushed_at":"2016-09-27T16:55:12Z","git_url":"git://github.com/18F/forest-service-prototype.git","ssh_url":"git@github.com:18F/forest-service-prototype.git","clone_url":"https://github.com/18F/forest-service-prototype.git","svn_url":"https://github.com/18F/forest-service-prototype","homepage":null,"size":1080,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":19,"forks":1,"open_issues":19,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/18F/forest-service-prototype/pulls/17"},"html":{"href":"https://github.com/18F/forest-service-prototype/pull/17"},"issue":{"href":"https://api.github.com/repos/18F/forest-service-prototype/issues/17"},"comments":{"href":"https://api.github.com/repos/18F/forest-service-prototype/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/18F/forest-service-prototype/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/18F/forest-service-prototype/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/18F/forest-service-prototype/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/18F/forest-service-prototype/statuses/851721646f15f58948241a290fffa18bed4ebb27"}}}}
{"actor":{"display_login":"fureigh"}}