{"action":"created","comment":{"url":"https://api.github.com/repos/stxnext-csr/volontulo/pulls/comments/41506133","id":41506133,"diff_hunk":"@@ -120,12 +120,23 @@ def organization_form(request, slug, id_):\n def organization_view(request, slug, id_):\n     u\"\"\"View responsible for viewing organization.\"\"\"\n     org = get_object_or_404(Organization, id=id_)\n-\n     offers = Offer.objects.filter(organization_id=id_)\n+    allow_contact = True\n+    allow_edit = False\n+    allow_offer_create = False\n+    if (\n+            request.user.is_authenticated() and\n+            request.user.userprofile in org.userprofiles.all()\n+    ):\n+        allow_contact = False\n+        allow_edit = True\n+        allow_offer_create = True\n+\n     if request.method == 'POST':\n         form = VolounteerToOrganizationContactForm(request.POST)\n         if form.is_valid():\n-            profile = UserProfile.objects.get(organization_id=id_)\n+            # send email to first organization user (I assume it's main user)\n+            profile = Organization.objects.get(id=id_).userprofiles.all()[0]","path":"volontulo/views/organizations.py","position":22,"original_position":22,"commit_id":"74fbd236fa2eb7b34282c8c02b3f46dff5d3e6d8","original_commit_id":"74fbd236fa2eb7b34282c8c02b3f46dff5d3e6d8","user":{"login":"filipgorczynski","id":467026,"avatar_url":"https://avatars.githubusercontent.com/u/467026?v=3","gravatar_id":"","url":"https://api.github.com/users/filipgorczynski","html_url":"https://github.com/filipgorczynski","followers_url":"https://api.github.com/users/filipgorczynski/followers","following_url":"https://api.github.com/users/filipgorczynski/following{/other_user}","gists_url":"https://api.github.com/users/filipgorczynski/gists{/gist_id}","starred_url":"https://api.github.com/users/filipgorczynski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filipgorczynski/subscriptions","organizations_url":"https://api.github.com/users/filipgorczynski/orgs","repos_url":"https://api.github.com/users/filipgorczynski/repos","events_url":"https://api.github.com/users/filipgorczynski/events{/privacy}","received_events_url":"https://api.github.com/users/filipgorczynski/received_events","type":"User","site_admin":false},"body":"This is something to talk about later. On contact form view, to contact with administrator we currently have dropdown that allow to select one of many administrators. So it's similar problem.","created_at":"2015-10-08T12:25:48Z","updated_at":"2015-10-08T12:25:48Z","html_url":"https://github.com/stxnext-csr/volontulo/pull/294#discussion_r41506133","pull_request_url":"https://api.github.com/repos/stxnext-csr/volontulo/pulls/294","_links":{"self":{"href":"https://api.github.com/repos/stxnext-csr/volontulo/pulls/comments/41506133"},"html":{"href":"https://github.com/stxnext-csr/volontulo/pull/294#discussion_r41506133"},"pull_request":{"href":"https://api.github.com/repos/stxnext-csr/volontulo/pulls/294"}}},"pull_request":{"url":"https://api.github.com/repos/stxnext-csr/volontulo/pulls/294","id":47004537,"html_url":"https://github.com/stxnext-csr/volontulo/pull/294","diff_url":"https://github.com/stxnext-csr/volontulo/pull/294.diff","patch_url":"https://github.com/stxnext-csr/volontulo/pull/294.patch","issue_url":"https://api.github.com/repos/stxnext-csr/volontulo/issues/294","number":294,"state":"open","locked":false,"title":"Bug 220 Unittests for view to preview organization page","user":{"login":"filipgorczynski","id":467026,"avatar_url":"https://avatars.githubusercontent.com/u/467026?v=3","gravatar_id":"","url":"https://api.github.com/users/filipgorczynski","html_url":"https://github.com/filipgorczynski","followers_url":"https://api.github.com/users/filipgorczynski/followers","following_url":"https://api.github.com/users/filipgorczynski/following{/other_user}","gists_url":"https://api.github.com/users/filipgorczynski/gists{/gist_id}","starred_url":"https://api.github.com/users/filipgorczynski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filipgorczynski/subscriptions","organizations_url":"https://api.github.com/users/filipgorczynski/orgs","repos_url":"https://api.github.com/users/filipgorczynski/repos","events_url":"https://api.github.com/users/filipgorczynski/events{/privacy}","received_events_url":"https://api.github.com/users/filipgorczynski/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-07T09:28:46Z","updated_at":"2015-10-08T12:25:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6150f3569e6d9774bd442bdd7b59c5d58bb93923","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/stxnext-csr/volontulo/pulls/294/commits","review_comments_url":"https://api.github.com/repos/stxnext-csr/volontulo/pulls/294/comments","review_comment_url":"https://api.github.com/repos/stxnext-csr/volontulo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stxnext-csr/volontulo/issues/294/comments","statuses_url":"https://api.github.com/repos/stxnext-csr/volontulo/statuses/74fbd236fa2eb7b34282c8c02b3f46dff5d3e6d8","head":{"label":"filipgorczynski:bug-220","ref":"bug-220","sha":"74fbd236fa2eb7b34282c8c02b3f46dff5d3e6d8","user":{"login":"filipgorczynski","id":467026,"avatar_url":"https://avatars.githubusercontent.com/u/467026?v=3","gravatar_id":"","url":"https://api.github.com/users/filipgorczynski","html_url":"https://github.com/filipgorczynski","followers_url":"https://api.github.com/users/filipgorczynski/followers","following_url":"https://api.github.com/users/filipgorczynski/following{/other_user}","gists_url":"https://api.github.com/users/filipgorczynski/gists{/gist_id}","starred_url":"https://api.github.com/users/filipgorczynski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filipgorczynski/subscriptions","organizations_url":"https://api.github.com/users/filipgorczynski/orgs","repos_url":"https://api.github.com/users/filipgorczynski/repos","events_url":"https://api.github.com/users/filipgorczynski/events{/privacy}","received_events_url":"https://api.github.com/users/filipgorczynski/received_events","type":"User","site_admin":false},"repo":{"id":42521519,"name":"volontulo","full_name":"filipgorczynski/volontulo","owner":{"login":"filipgorczynski","id":467026,"avatar_url":"https://avatars.githubusercontent.com/u/467026?v=3","gravatar_id":"","url":"https://api.github.com/users/filipgorczynski","html_url":"https://github.com/filipgorczynski","followers_url":"https://api.github.com/users/filipgorczynski/followers","following_url":"https://api.github.com/users/filipgorczynski/following{/other_user}","gists_url":"https://api.github.com/users/filipgorczynski/gists{/gist_id}","starred_url":"https://api.github.com/users/filipgorczynski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filipgorczynski/subscriptions","organizations_url":"https://api.github.com/users/filipgorczynski/orgs","repos_url":"https://api.github.com/users/filipgorczynski/repos","events_url":"https://api.github.com/users/filipgorczynski/events{/privacy}","received_events_url":"https://api.github.com/users/filipgorczynski/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/filipgorczynski/volontulo","description":"Portal łączący wolontariuszy, organizacje i instytucje.","fork":true,"url":"https://api.github.com/repos/filipgorczynski/volontulo","forks_url":"https://api.github.com/repos/filipgorczynski/volontulo/forks","keys_url":"https://api.github.com/repos/filipgorczynski/volontulo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/filipgorczynski/volontulo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/filipgorczynski/volontulo/teams","hooks_url":"https://api.github.com/repos/filipgorczynski/volontulo/hooks","issue_events_url":"https://api.github.com/repos/filipgorczynski/volontulo/issues/events{/number}","events_url":"https://api.github.com/repos/filipgorczynski/volontulo/events","assignees_url":"https://api.github.com/repos/filipgorczynski/volontulo/assignees{/user}","branches_url":"https://api.github.com/repos/filipgorczynski/volontulo/branches{/branch}","tags_url":"https://api.github.com/repos/filipgorczynski/volontulo/tags","blobs_url":"https://api.github.com/repos/filipgorczynski/volontulo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/filipgorczynski/volontulo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/filipgorczynski/volontulo/git/refs{/sha}","trees_url":"https://api.github.com/repos/filipgorczynski/volontulo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/filipgorczynski/volontulo/statuses/{sha}","languages_url":"https://api.github.com/repos/filipgorczynski/volontulo/languages","stargazers_url":"https://api.github.com/repos/filipgorczynski/volontulo/stargazers","contributors_url":"https://api.github.com/repos/filipgorczynski/volontulo/contributors","subscribers_url":"https://api.github.com/repos/filipgorczynski/volontulo/subscribers","subscription_url":"https://api.github.com/repos/filipgorczynski/volontulo/subscription","commits_url":"https://api.github.com/repos/filipgorczynski/volontulo/commits{/sha}","git_commits_url":"https://api.github.com/repos/filipgorczynski/volontulo/git/commits{/sha}","comments_url":"https://api.github.com/repos/filipgorczynski/volontulo/comments{/number}","issue_comment_url":"https://api.github.com/repos/filipgorczynski/volontulo/issues/comments{/number}","contents_url":"https://api.github.com/repos/filipgorczynski/volontulo/contents/{+path}","compare_url":"https://api.github.com/repos/filipgorczynski/volontulo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/filipgorczynski/volontulo/merges","archive_url":"https://api.github.com/repos/filipgorczynski/volontulo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/filipgorczynski/volontulo/downloads","issues_url":"https://api.github.com/repos/filipgorczynski/volontulo/issues{/number}","pulls_url":"https://api.github.com/repos/filipgorczynski/volontulo/pulls{/number}","milestones_url":"https://api.github.com/repos/filipgorczynski/volontulo/milestones{/number}","notifications_url":"https://api.github.com/repos/filipgorczynski/volontulo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/filipgorczynski/volontulo/labels{/name}","releases_url":"https://api.github.com/repos/filipgorczynski/volontulo/releases{/id}","created_at":"2015-09-15T13:35:41Z","updated_at":"2015-09-24T09:16:37Z","pushed_at":"2015-10-08T12:14:54Z","git_url":"git://github.com/filipgorczynski/volontulo.git","ssh_url":"git@github.com:filipgorczynski/volontulo.git","clone_url":"https://github.com/filipgorczynski/volontulo.git","svn_url":"https://github.com/filipgorczynski/volontulo","homepage":null,"size":831,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"stxnext-csr:master","ref":"master","sha":"8eac431e56070d41026db118386b8f70bb5fbd30","user":{"login":"stxnext-csr","id":14179451,"avatar_url":"https://avatars.githubusercontent.com/u/14179451?v=3","gravatar_id":"","url":"https://api.github.com/users/stxnext-csr","html_url":"https://github.com/stxnext-csr","followers_url":"https://api.github.com/users/stxnext-csr/followers","following_url":"https://api.github.com/users/stxnext-csr/following{/other_user}","gists_url":"https://api.github.com/users/stxnext-csr/gists{/gist_id}","starred_url":"https://api.github.com/users/stxnext-csr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stxnext-csr/subscriptions","organizations_url":"https://api.github.com/users/stxnext-csr/orgs","repos_url":"https://api.github.com/users/stxnext-csr/repos","events_url":"https://api.github.com/users/stxnext-csr/events{/privacy}","received_events_url":"https://api.github.com/users/stxnext-csr/received_events","type":"Organization","site_admin":false},"repo":{"id":42171724,"name":"volontulo","full_name":"stxnext-csr/volontulo","owner":{"login":"stxnext-csr","id":14179451,"avatar_url":"https://avatars.githubusercontent.com/u/14179451?v=3","gravatar_id":"","url":"https://api.github.com/users/stxnext-csr","html_url":"https://github.com/stxnext-csr","followers_url":"https://api.github.com/users/stxnext-csr/followers","following_url":"https://api.github.com/users/stxnext-csr/following{/other_user}","gists_url":"https://api.github.com/users/stxnext-csr/gists{/gist_id}","starred_url":"https://api.github.com/users/stxnext-csr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stxnext-csr/subscriptions","organizations_url":"https://api.github.com/users/stxnext-csr/orgs","repos_url":"https://api.github.com/users/stxnext-csr/repos","events_url":"https://api.github.com/users/stxnext-csr/events{/privacy}","received_events_url":"https://api.github.com/users/stxnext-csr/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stxnext-csr/volontulo","description":"Web portal for collaboration of community volunteers with organizations and institutions.","fork":false,"url":"https://api.github.com/repos/stxnext-csr/volontulo","forks_url":"https://api.github.com/repos/stxnext-csr/volontulo/forks","keys_url":"https://api.github.com/repos/stxnext-csr/volontulo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stxnext-csr/volontulo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stxnext-csr/volontulo/teams","hooks_url":"https://api.github.com/repos/stxnext-csr/volontulo/hooks","issue_events_url":"https://api.github.com/repos/stxnext-csr/volontulo/issues/events{/number}","events_url":"https://api.github.com/repos/stxnext-csr/volontulo/events","assignees_url":"https://api.github.com/repos/stxnext-csr/volontulo/assignees{/user}","branches_url":"https://api.github.com/repos/stxnext-csr/volontulo/branches{/branch}","tags_url":"https://api.github.com/repos/stxnext-csr/volontulo/tags","blobs_url":"https://api.github.com/repos/stxnext-csr/volontulo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stxnext-csr/volontulo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stxnext-csr/volontulo/git/refs{/sha}","trees_url":"https://api.github.com/repos/stxnext-csr/volontulo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stxnext-csr/volontulo/statuses/{sha}","languages_url":"https://api.github.com/repos/stxnext-csr/volontulo/languages","stargazers_url":"https://api.github.com/repos/stxnext-csr/volontulo/stargazers","contributors_url":"https://api.github.com/repos/stxnext-csr/volontulo/contributors","subscribers_url":"https://api.github.com/repos/stxnext-csr/volontulo/subscribers","subscription_url":"https://api.github.com/repos/stxnext-csr/volontulo/subscription","commits_url":"https://api.github.com/repos/stxnext-csr/volontulo/commits{/sha}","git_commits_url":"https://api.github.com/repos/stxnext-csr/volontulo/git/commits{/sha}","comments_url":"https://api.github.com/repos/stxnext-csr/volontulo/comments{/number}","issue_comment_url":"https://api.github.com/repos/stxnext-csr/volontulo/issues/comments{/number}","contents_url":"https://api.github.com/repos/stxnext-csr/volontulo/contents/{+path}","compare_url":"https://api.github.com/repos/stxnext-csr/volontulo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stxnext-csr/volontulo/merges","archive_url":"https://api.github.com/repos/stxnext-csr/volontulo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stxnext-csr/volontulo/downloads","issues_url":"https://api.github.com/repos/stxnext-csr/volontulo/issues{/number}","pulls_url":"https://api.github.com/repos/stxnext-csr/volontulo/pulls{/number}","milestones_url":"https://api.github.com/repos/stxnext-csr/volontulo/milestones{/number}","notifications_url":"https://api.github.com/repos/stxnext-csr/volontulo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stxnext-csr/volontulo/labels{/name}","releases_url":"https://api.github.com/repos/stxnext-csr/volontulo/releases{/id}","created_at":"2015-09-09T10:23:12Z","updated_at":"2015-09-23T14:00:23Z","pushed_at":"2015-10-08T12:18:42Z","git_url":"git://github.com/stxnext-csr/volontulo.git","ssh_url":"git@github.com:stxnext-csr/volontulo.git","clone_url":"https://github.com/stxnext-csr/volontulo.git","svn_url":"https://github.com/stxnext-csr/volontulo","homepage":"","size":1433,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":69,"forks":5,"open_issues":69,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/stxnext-csr/volontulo/pulls/294"},"html":{"href":"https://github.com/stxnext-csr/volontulo/pull/294"},"issue":{"href":"https://api.github.com/repos/stxnext-csr/volontulo/issues/294"},"comments":{"href":"https://api.github.com/repos/stxnext-csr/volontulo/issues/294/comments"},"review_comments":{"href":"https://api.github.com/repos/stxnext-csr/volontulo/pulls/294/comments"},"review_comment":{"href":"https://api.github.com/repos/stxnext-csr/volontulo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stxnext-csr/volontulo/pulls/294/commits"},"statuses":{"href":"https://api.github.com/repos/stxnext-csr/volontulo/statuses/74fbd236fa2eb7b34282c8c02b3f46dff5d3e6d8"}}}}