{"action":"created","comment":{"url":"https://api.github.com/repos/liqd/a4-meinberlin/pulls/comments/139986413","pull_request_review_id":63995103,"id":139986413,"diff_hunk":"@@ -105,3 +115,165 @@ def validate_object_project(self):\n \n     def validate_object_module(self):\n         return True\n+\n+\n+class AbstractProjectUserListView(a4dashboard_mixins.DashboardComponentMixin,\n+                                  a4dashboard_mixins.DashboardBaseMixin,\n+                                  a4dashboard_mixins.DashboardContextMixin,\n+                                  generic.base.TemplateResponseMixin,\n+                                  generic.edit.FormMixin,\n+                                  generic.detail.SingleObjectMixin,\n+                                  generic.edit.ProcessFormView):\n+\n+    form_class = forms.AddUsersFromEmailForm\n+\n+    def get(self, request, *args, **kwargs):\n+        self.object = self.get_object()\n+        return super().get(request, *args, **kwargs)\n+\n+    def post(self, request, *args, **kwargs):\n+        self.object = self.get_object()\n+        if 'submit_action' in request.POST:\n+            if request.POST['submit_action'] == 'remove_user':\n+                pk = int(request.POST['user_pk'])\n+                user = get_object_or_404(User, pk=pk)\n+\n+                if request.POST['submit_action'] == 'remove_user':\n+                    related_users = getattr(self.object,\n+                                            self.related_users_field)\n+                    related_users.remove(user)\n+                    messages.success(request, self.success_message_removal)\n+\n+            return redirect(self.get_success_url())\n+        else:\n+            return super().post(request, *args, **kwargs)\n+\n+    def form_valid(self, form):\n+        if form.missing:\n+            messages.error(\n+                self.request,\n+                _('Following emails are not registered: ') + ', '.join(\n+                    form.missing)\n+            )\n+\n+        if form.cleaned_data['add_users']:\n+            users = form.cleaned_data['add_users']\n+            related_users = getattr(self.object,\n+                                    self.related_users_field)\n+            related_users.add(*users)\n+\n+            messages.success(\n+                self.request,\n+                ungettext(self.success_message[0], self.success_message[1],\n+                          len(users)).format(len(users))\n+            )\n+\n+        return redirect(self.get_success_url())\n+\n+    def get_form_kwargs(self):\n+        kwargs = super().get_form_kwargs()\n+        kwargs['label'] = self.add_user_field_label\n+        return kwargs\n+\n+\n+class AbstractProjectUserInviteListView(AbstractProjectUserListView):","path":"meinberlin/apps/dashboard/views.py","position":94,"original_position":94,"commit_id":"891b27cbf428fe7f8cc23f58a96d384864bfbbf4","original_commit_id":"234a86bc0774aa37f9fb3ce4903615876b1eaab1","user":{"login":"2e2a","id":16001917,"avatar_url":"https://avatars0.githubusercontent.com/u/16001917?v=4","gravatar_id":"","url":"https://api.github.com/users/2e2a","html_url":"https://github.com/2e2a","followers_url":"https://api.github.com/users/2e2a/followers","following_url":"https://api.github.com/users/2e2a/following{/other_user}","gists_url":"https://api.github.com/users/2e2a/gists{/gist_id}","starred_url":"https://api.github.com/users/2e2a/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2e2a/subscriptions","organizations_url":"https://api.github.com/users/2e2a/orgs","repos_url":"https://api.github.com/users/2e2a/repos","events_url":"https://api.github.com/users/2e2a/events{/privacy}","received_events_url":"https://api.github.com/users/2e2a/received_events","type":"User","site_admin":false},"body":"I was thinking that this might be useful for some other feature later.","created_at":"2017-09-20T14:30:38Z","updated_at":"2017-09-20T14:30:38Z","html_url":"https://github.com/liqd/a4-meinberlin/pull/810#discussion_r139986413","pull_request_url":"https://api.github.com/repos/liqd/a4-meinberlin/pulls/810","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/liqd/a4-meinberlin/pulls/comments/139986413"},"html":{"href":"https://github.com/liqd/a4-meinberlin/pull/810#discussion_r139986413"},"pull_request":{"href":"https://api.github.com/repos/liqd/a4-meinberlin/pulls/810"}},"in_reply_to_id":139986062},"pull_request":{"url":"https://api.github.com/repos/liqd/a4-meinberlin/pulls/810","id":142030834,"html_url":"https://github.com/liqd/a4-meinberlin/pull/810","diff_url":"https://github.com/liqd/a4-meinberlin/pull/810.diff","patch_url":"https://github.com/liqd/a4-meinberlin/pull/810.patch","issue_url":"https://api.github.com/repos/liqd/a4-meinberlin/issues/810","number":810,"state":"open","locked":false,"title":"Invite","user":{"login":"2e2a","id":16001917,"avatar_url":"https://avatars0.githubusercontent.com/u/16001917?v=4","gravatar_id":"","url":"https://api.github.com/users/2e2a","html_url":"https://github.com/2e2a","followers_url":"https://api.github.com/users/2e2a/followers","following_url":"https://api.github.com/users/2e2a/following{/other_user}","gists_url":"https://api.github.com/users/2e2a/gists{/gist_id}","starred_url":"https://api.github.com/users/2e2a/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2e2a/subscriptions","organizations_url":"https://api.github.com/users/2e2a/orgs","repos_url":"https://api.github.com/users/2e2a/repos","events_url":"https://api.github.com/users/2e2a/events{/privacy}","received_events_url":"https://api.github.com/users/2e2a/received_events","type":"User","site_admin":false},"body":"Copy of a4-opin membership app with small changes and extended for moderators.\r\n\r\nThe invite templates probably still need some work.\r\nI'm also not that happy with the abstract invite model solution.","created_at":"2017-09-20T07:45:48Z","updated_at":"2017-09-20T14:30:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"527eafbce0156643a55e14b5dd9875cfbf75cde4","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/liqd/a4-meinberlin/pulls/810/commits","review_comments_url":"https://api.github.com/repos/liqd/a4-meinberlin/pulls/810/comments","review_comment_url":"https://api.github.com/repos/liqd/a4-meinberlin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/liqd/a4-meinberlin/issues/810/comments","statuses_url":"https://api.github.com/repos/liqd/a4-meinberlin/statuses/891b27cbf428fe7f8cc23f58a96d384864bfbbf4","head":{"label":"liqd:2017-09-as-invite","ref":"2017-09-as-invite","sha":"891b27cbf428fe7f8cc23f58a96d384864bfbbf4","user":{"login":"liqd","id":2312088,"avatar_url":"https://avatars3.githubusercontent.com/u/2312088?v=4","gravatar_id":"","url":"https://api.github.com/users/liqd","html_url":"https://github.com/liqd","followers_url":"https://api.github.com/users/liqd/followers","following_url":"https://api.github.com/users/liqd/following{/other_user}","gists_url":"https://api.github.com/users/liqd/gists{/gist_id}","starred_url":"https://api.github.com/users/liqd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liqd/subscriptions","organizations_url":"https://api.github.com/users/liqd/orgs","repos_url":"https://api.github.com/users/liqd/repos","events_url":"https://api.github.com/users/liqd/events{/privacy}","received_events_url":"https://api.github.com/users/liqd/received_events","type":"Organization","site_admin":false},"repo":{"id":76258093,"name":"a4-meinberlin","full_name":"liqd/a4-meinberlin","owner":{"login":"liqd","id":2312088,"avatar_url":"https://avatars3.githubusercontent.com/u/2312088?v=4","gravatar_id":"","url":"https://api.github.com/users/liqd","html_url":"https://github.com/liqd","followers_url":"https://api.github.com/users/liqd/followers","following_url":"https://api.github.com/users/liqd/following{/other_user}","gists_url":"https://api.github.com/users/liqd/gists{/gist_id}","starred_url":"https://api.github.com/users/liqd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liqd/subscriptions","organizations_url":"https://api.github.com/users/liqd/orgs","repos_url":"https://api.github.com/users/liqd/repos","events_url":"https://api.github.com/users/liqd/events{/privacy}","received_events_url":"https://api.github.com/users/liqd/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/liqd/a4-meinberlin","description":"Participation platform mein.berlin","fork":false,"url":"https://api.github.com/repos/liqd/a4-meinberlin","forks_url":"https://api.github.com/repos/liqd/a4-meinberlin/forks","keys_url":"https://api.github.com/repos/liqd/a4-meinberlin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/liqd/a4-meinberlin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/liqd/a4-meinberlin/teams","hooks_url":"https://api.github.com/repos/liqd/a4-meinberlin/hooks","issue_events_url":"https://api.github.com/repos/liqd/a4-meinberlin/issues/events{/number}","events_url":"https://api.github.com/repos/liqd/a4-meinberlin/events","assignees_url":"https://api.github.com/repos/liqd/a4-meinberlin/assignees{/user}","branches_url":"https://api.github.com/repos/liqd/a4-meinberlin/branches{/branch}","tags_url":"https://api.github.com/repos/liqd/a4-meinberlin/tags","blobs_url":"https://api.github.com/repos/liqd/a4-meinberlin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/liqd/a4-meinberlin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/liqd/a4-meinberlin/git/refs{/sha}","trees_url":"https://api.github.com/repos/liqd/a4-meinberlin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/liqd/a4-meinberlin/statuses/{sha}","languages_url":"https://api.github.com/repos/liqd/a4-meinberlin/languages","stargazers_url":"https://api.github.com/repos/liqd/a4-meinberlin/stargazers","contributors_url":"https://api.github.com/repos/liqd/a4-meinberlin/contributors","subscribers_url":"https://api.github.com/repos/liqd/a4-meinberlin/subscribers","subscription_url":"https://api.github.com/repos/liqd/a4-meinberlin/subscription","commits_url":"https://api.github.com/repos/liqd/a4-meinberlin/commits{/sha}","git_commits_url":"https://api.github.com/repos/liqd/a4-meinberlin/git/commits{/sha}","comments_url":"https://api.github.com/repos/liqd/a4-meinberlin/comments{/number}","issue_comment_url":"https://api.github.com/repos/liqd/a4-meinberlin/issues/comments{/number}","contents_url":"https://api.github.com/repos/liqd/a4-meinberlin/contents/{+path}","compare_url":"https://api.github.com/repos/liqd/a4-meinberlin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/liqd/a4-meinberlin/merges","archive_url":"https://api.github.com/repos/liqd/a4-meinberlin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/liqd/a4-meinberlin/downloads","issues_url":"https://api.github.com/repos/liqd/a4-meinberlin/issues{/number}","pulls_url":"https://api.github.com/repos/liqd/a4-meinberlin/pulls{/number}","milestones_url":"https://api.github.com/repos/liqd/a4-meinberlin/milestones{/number}","notifications_url":"https://api.github.com/repos/liqd/a4-meinberlin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/liqd/a4-meinberlin/labels{/name}","releases_url":"https://api.github.com/repos/liqd/a4-meinberlin/releases{/id}","deployments_url":"https://api.github.com/repos/liqd/a4-meinberlin/deployments","created_at":"2016-12-12T13:19:42Z","updated_at":"2017-08-30T16:14:34Z","pushed_at":"2017-09-20T14:28:34Z","git_url":"git://github.com/liqd/a4-meinberlin.git","ssh_url":"git@github.com:liqd/a4-meinberlin.git","clone_url":"https://github.com/liqd/a4-meinberlin.git","svn_url":"https://github.com/liqd/a4-meinberlin","homepage":"https://mein.berlin.de","size":3443,"stargazers_count":8,"watchers_count":8,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":41,"forks":1,"open_issues":41,"watchers":8,"default_branch":"master"}},"base":{"label":"liqd:master","ref":"master","sha":"c251d6d7214a324ad2efdcecad977c20180aef3f","user":{"login":"liqd","id":2312088,"avatar_url":"https://avatars3.githubusercontent.com/u/2312088?v=4","gravatar_id":"","url":"https://api.github.com/users/liqd","html_url":"https://github.com/liqd","followers_url":"https://api.github.com/users/liqd/followers","following_url":"https://api.github.com/users/liqd/following{/other_user}","gists_url":"https://api.github.com/users/liqd/gists{/gist_id}","starred_url":"https://api.github.com/users/liqd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liqd/subscriptions","organizations_url":"https://api.github.com/users/liqd/orgs","repos_url":"https://api.github.com/users/liqd/repos","events_url":"https://api.github.com/users/liqd/events{/privacy}","received_events_url":"https://api.github.com/users/liqd/received_events","type":"Organization","site_admin":false},"repo":{"id":76258093,"name":"a4-meinberlin","full_name":"liqd/a4-meinberlin","owner":{"login":"liqd","id":2312088,"avatar_url":"https://avatars3.githubusercontent.com/u/2312088?v=4","gravatar_id":"","url":"https://api.github.com/users/liqd","html_url":"https://github.com/liqd","followers_url":"https://api.github.com/users/liqd/followers","following_url":"https://api.github.com/users/liqd/following{/other_user}","gists_url":"https://api.github.com/users/liqd/gists{/gist_id}","starred_url":"https://api.github.com/users/liqd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liqd/subscriptions","organizations_url":"https://api.github.com/users/liqd/orgs","repos_url":"https://api.github.com/users/liqd/repos","events_url":"https://api.github.com/users/liqd/events{/privacy}","received_events_url":"https://api.github.com/users/liqd/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/liqd/a4-meinberlin","description":"Participation platform mein.berlin","fork":false,"url":"https://api.github.com/repos/liqd/a4-meinberlin","forks_url":"https://api.github.com/repos/liqd/a4-meinberlin/forks","keys_url":"https://api.github.com/repos/liqd/a4-meinberlin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/liqd/a4-meinberlin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/liqd/a4-meinberlin/teams","hooks_url":"https://api.github.com/repos/liqd/a4-meinberlin/hooks","issue_events_url":"https://api.github.com/repos/liqd/a4-meinberlin/issues/events{/number}","events_url":"https://api.github.com/repos/liqd/a4-meinberlin/events","assignees_url":"https://api.github.com/repos/liqd/a4-meinberlin/assignees{/user}","branches_url":"https://api.github.com/repos/liqd/a4-meinberlin/branches{/branch}","tags_url":"https://api.github.com/repos/liqd/a4-meinberlin/tags","blobs_url":"https://api.github.com/repos/liqd/a4-meinberlin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/liqd/a4-meinberlin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/liqd/a4-meinberlin/git/refs{/sha}","trees_url":"https://api.github.com/repos/liqd/a4-meinberlin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/liqd/a4-meinberlin/statuses/{sha}","languages_url":"https://api.github.com/repos/liqd/a4-meinberlin/languages","stargazers_url":"https://api.github.com/repos/liqd/a4-meinberlin/stargazers","contributors_url":"https://api.github.com/repos/liqd/a4-meinberlin/contributors","subscribers_url":"https://api.github.com/repos/liqd/a4-meinberlin/subscribers","subscription_url":"https://api.github.com/repos/liqd/a4-meinberlin/subscription","commits_url":"https://api.github.com/repos/liqd/a4-meinberlin/commits{/sha}","git_commits_url":"https://api.github.com/repos/liqd/a4-meinberlin/git/commits{/sha}","comments_url":"https://api.github.com/repos/liqd/a4-meinberlin/comments{/number}","issue_comment_url":"https://api.github.com/repos/liqd/a4-meinberlin/issues/comments{/number}","contents_url":"https://api.github.com/repos/liqd/a4-meinberlin/contents/{+path}","compare_url":"https://api.github.com/repos/liqd/a4-meinberlin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/liqd/a4-meinberlin/merges","archive_url":"https://api.github.com/repos/liqd/a4-meinberlin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/liqd/a4-meinberlin/downloads","issues_url":"https://api.github.com/repos/liqd/a4-meinberlin/issues{/number}","pulls_url":"https://api.github.com/repos/liqd/a4-meinberlin/pulls{/number}","milestones_url":"https://api.github.com/repos/liqd/a4-meinberlin/milestones{/number}","notifications_url":"https://api.github.com/repos/liqd/a4-meinberlin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/liqd/a4-meinberlin/labels{/name}","releases_url":"https://api.github.com/repos/liqd/a4-meinberlin/releases{/id}","deployments_url":"https://api.github.com/repos/liqd/a4-meinberlin/deployments","created_at":"2016-12-12T13:19:42Z","updated_at":"2017-08-30T16:14:34Z","pushed_at":"2017-09-20T14:28:34Z","git_url":"git://github.com/liqd/a4-meinberlin.git","ssh_url":"git@github.com:liqd/a4-meinberlin.git","clone_url":"https://github.com/liqd/a4-meinberlin.git","svn_url":"https://github.com/liqd/a4-meinberlin","homepage":"https://mein.berlin.de","size":3443,"stargazers_count":8,"watchers_count":8,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":41,"forks":1,"open_issues":41,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/liqd/a4-meinberlin/pulls/810"},"html":{"href":"https://github.com/liqd/a4-meinberlin/pull/810"},"issue":{"href":"https://api.github.com/repos/liqd/a4-meinberlin/issues/810"},"comments":{"href":"https://api.github.com/repos/liqd/a4-meinberlin/issues/810/comments"},"review_comments":{"href":"https://api.github.com/repos/liqd/a4-meinberlin/pulls/810/comments"},"review_comment":{"href":"https://api.github.com/repos/liqd/a4-meinberlin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/liqd/a4-meinberlin/pulls/810/commits"},"statuses":{"href":"https://api.github.com/repos/liqd/a4-meinberlin/statuses/891b27cbf428fe7f8cc23f58a96d384864bfbbf4"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"2e2a"}}