{"action":"created","comment":{"url":"https://api.github.com/repos/eJourn-al/eJournal/pulls/comments/215912792","pull_request_review_id":153281833,"id":215912792,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNTkxMjc5Mg==","diff_hunk":"@@ -41,7 +41,44 @@ def delete_course(request):\n     course = Course.objects.get(pk=cID)\n     course.delete()\n \n-    return responses.success(description='Succesfully deleted course')\n+    return responses.success(message='Succesfully deleted course')\n+\n+\n+@api_view(['POST'])\n+def delete_course_group(request):\n+    \"\"\"Delete an existing course group.\n+\n+    Arguments:\n+    request -- the update request that was send with\n+        group_name -- name of the group\n+        cID -- course ID given with the request\n+\n+    Returns a json string for if it is successful or not.\n+    \"\"\"\n+    user = request.user\n+    if not user.is_authenticated:\n+        return responses.unauthorized()\n+\n+    try:\n+        name, cID = utils.required_params(request.data, 'name', 'cID')\n+    except KeyError:\n+        return responses.keyerror('name', 'cID')\n+\n+    role = permissions.get_role(user, cID)\n+    if role is None:\n+        return responses.unauthorized(description=\"You have no access to this course\")\n+    elif not role.can_delete_course_user_group:\n+        return responses.forbidden(description=\"You have no permissions to delete a course group.\")\n+\n+    course = Course.objects.get(pk=cID)\n+    course_group = Group.objects.get(name=name, course=course)\n+\n+    if course_group:\n+        course_group.delete()\n+    else:\n+        return responses.not_found('Course group does not exist.')\n+\n+    return responses.success(message='Succesfully deleted course group')","path":"src/django/VLE/views/delete.py","position":51,"original_position":51,"commit_id":"21e405fe33f0bbb20c8f8961c3f7c0edd4f7805f","original_commit_id":"21e405fe33f0bbb20c8f8961c3f7c0edd4f7805f","user":{"login":"Larspolo","id":11822478,"node_id":"MDQ6VXNlcjExODIyNDc4","avatar_url":"https://avatars2.githubusercontent.com/u/11822478?v=4","gravatar_id":"","url":"https://api.github.com/users/Larspolo","html_url":"https://github.com/Larspolo","followers_url":"https://api.github.com/users/Larspolo/followers","following_url":"https://api.github.com/users/Larspolo/following{/other_user}","gists_url":"https://api.github.com/users/Larspolo/gists{/gist_id}","starred_url":"https://api.github.com/users/Larspolo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Larspolo/subscriptions","organizations_url":"https://api.github.com/users/Larspolo/orgs","repos_url":"https://api.github.com/users/Larspolo/repos","events_url":"https://api.github.com/users/Larspolo/events{/privacy}","received_events_url":"https://api.github.com/users/Larspolo/received_events","type":"User","site_admin":false},"body":"Should be description=","created_at":"2018-09-07T10:14:00Z","updated_at":"2018-09-07T10:16:00Z","html_url":"https://github.com/eJourn-al/eJournal/pull/283#discussion_r215912792","pull_request_url":"https://api.github.com/repos/eJourn-al/eJournal/pulls/283","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/eJourn-al/eJournal/pulls/comments/215912792"},"html":{"href":"https://github.com/eJourn-al/eJournal/pull/283#discussion_r215912792"},"pull_request":{"href":"https://api.github.com/repos/eJourn-al/eJournal/pulls/283"}}},"pull_request":{"url":"https://api.github.com/repos/eJourn-al/eJournal/pulls/283","id":210430616,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEwNDMwNjE2","html_url":"https://github.com/eJourn-al/eJournal/pull/283","diff_url":"https://github.com/eJourn-al/eJournal/pull/283.diff","patch_url":"https://github.com/eJourn-al/eJournal/pull/283.patch","issue_url":"https://api.github.com/repos/eJourn-al/eJournal/issues/283","number":283,"state":"open","locked":false,"title":"Feature/sort group","user":{"login":"JowehL","id":15890415,"node_id":"MDQ6VXNlcjE1ODkwNDE1","avatar_url":"https://avatars0.githubusercontent.com/u/15890415?v=4","gravatar_id":"","url":"https://api.github.com/users/JowehL","html_url":"https://github.com/JowehL","followers_url":"https://api.github.com/users/JowehL/followers","following_url":"https://api.github.com/users/JowehL/following{/other_user}","gists_url":"https://api.github.com/users/JowehL/gists{/gist_id}","starred_url":"https://api.github.com/users/JowehL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JowehL/subscriptions","organizations_url":"https://api.github.com/users/JowehL/orgs","repos_url":"https://api.github.com/users/JowehL/repos","events_url":"https://api.github.com/users/JowehL/events{/privacy}","received_events_url":"https://api.github.com/users/JowehL/received_events","type":"User","site_admin":false},"body":"## Description\r\nBack-end and front-end implementation of group(except for deleting on the front-end)\r\n","created_at":"2018-08-23T12:27:15Z","updated_at":"2018-09-07T10:16:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c6456802eb6e23edc0180ace411d5a02fcd8c5cf","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/eJourn-al/eJournal/pulls/283/commits","review_comments_url":"https://api.github.com/repos/eJourn-al/eJournal/pulls/283/comments","review_comment_url":"https://api.github.com/repos/eJourn-al/eJournal/pulls/comments{/number}","comments_url":"https://api.github.com/repos/eJourn-al/eJournal/issues/283/comments","statuses_url":"https://api.github.com/repos/eJourn-al/eJournal/statuses/21e405fe33f0bbb20c8f8961c3f7c0edd4f7805f","head":{"label":"eJourn-al:feature/sort-group","ref":"feature/sort-group","sha":"21e405fe33f0bbb20c8f8961c3f7c0edd4f7805f","user":{"login":"eJourn-al","id":41028230,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDI4MjMw","avatar_url":"https://avatars3.githubusercontent.com/u/41028230?v=4","gravatar_id":"","url":"https://api.github.com/users/eJourn-al","html_url":"https://github.com/eJourn-al","followers_url":"https://api.github.com/users/eJourn-al/followers","following_url":"https://api.github.com/users/eJourn-al/following{/other_user}","gists_url":"https://api.github.com/users/eJourn-al/gists{/gist_id}","starred_url":"https://api.github.com/users/eJourn-al/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eJourn-al/subscriptions","organizations_url":"https://api.github.com/users/eJourn-al/orgs","repos_url":"https://api.github.com/users/eJourn-al/repos","events_url":"https://api.github.com/users/eJourn-al/events{/privacy}","received_events_url":"https://api.github.com/users/eJourn-al/received_events","type":"Organization","site_admin":false},"repo":{"id":136030378,"node_id":"MDEwOlJlcG9zaXRvcnkxMzYwMzAzNzg=","name":"eJournal","full_name":"eJourn-al/eJournal","owner":{"login":"eJourn-al","id":41028230,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDI4MjMw","avatar_url":"https://avatars3.githubusercontent.com/u/41028230?v=4","gravatar_id":"","url":"https://api.github.com/users/eJourn-al","html_url":"https://github.com/eJourn-al","followers_url":"https://api.github.com/users/eJourn-al/followers","following_url":"https://api.github.com/users/eJourn-al/following{/other_user}","gists_url":"https://api.github.com/users/eJourn-al/gists{/gist_id}","starred_url":"https://api.github.com/users/eJourn-al/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eJourn-al/subscriptions","organizations_url":"https://api.github.com/users/eJourn-al/orgs","repos_url":"https://api.github.com/users/eJourn-al/repos","events_url":"https://api.github.com/users/eJourn-al/events{/privacy}","received_events_url":"https://api.github.com/users/eJourn-al/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/eJourn-al/eJournal","description":"Platform for long term assignments in virtual learning environments.","fork":false,"url":"https://api.github.com/repos/eJourn-al/eJournal","forks_url":"https://api.github.com/repos/eJourn-al/eJournal/forks","keys_url":"https://api.github.com/repos/eJourn-al/eJournal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eJourn-al/eJournal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eJourn-al/eJournal/teams","hooks_url":"https://api.github.com/repos/eJourn-al/eJournal/hooks","issue_events_url":"https://api.github.com/repos/eJourn-al/eJournal/issues/events{/number}","events_url":"https://api.github.com/repos/eJourn-al/eJournal/events","assignees_url":"https://api.github.com/repos/eJourn-al/eJournal/assignees{/user}","branches_url":"https://api.github.com/repos/eJourn-al/eJournal/branches{/branch}","tags_url":"https://api.github.com/repos/eJourn-al/eJournal/tags","blobs_url":"https://api.github.com/repos/eJourn-al/eJournal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eJourn-al/eJournal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eJourn-al/eJournal/git/refs{/sha}","trees_url":"https://api.github.com/repos/eJourn-al/eJournal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eJourn-al/eJournal/statuses/{sha}","languages_url":"https://api.github.com/repos/eJourn-al/eJournal/languages","stargazers_url":"https://api.github.com/repos/eJourn-al/eJournal/stargazers","contributors_url":"https://api.github.com/repos/eJourn-al/eJournal/contributors","subscribers_url":"https://api.github.com/repos/eJourn-al/eJournal/subscribers","subscription_url":"https://api.github.com/repos/eJourn-al/eJournal/subscription","commits_url":"https://api.github.com/repos/eJourn-al/eJournal/commits{/sha}","git_commits_url":"https://api.github.com/repos/eJourn-al/eJournal/git/commits{/sha}","comments_url":"https://api.github.com/repos/eJourn-al/eJournal/comments{/number}","issue_comment_url":"https://api.github.com/repos/eJourn-al/eJournal/issues/comments{/number}","contents_url":"https://api.github.com/repos/eJourn-al/eJournal/contents/{+path}","compare_url":"https://api.github.com/repos/eJourn-al/eJournal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eJourn-al/eJournal/merges","archive_url":"https://api.github.com/repos/eJourn-al/eJournal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eJourn-al/eJournal/downloads","issues_url":"https://api.github.com/repos/eJourn-al/eJournal/issues{/number}","pulls_url":"https://api.github.com/repos/eJourn-al/eJournal/pulls{/number}","milestones_url":"https://api.github.com/repos/eJourn-al/eJournal/milestones{/number}","notifications_url":"https://api.github.com/repos/eJourn-al/eJournal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eJourn-al/eJournal/labels{/name}","releases_url":"https://api.github.com/repos/eJourn-al/eJournal/releases{/id}","deployments_url":"https://api.github.com/repos/eJourn-al/eJournal/deployments","created_at":"2018-06-04T13:36:31Z","updated_at":"2018-09-06T22:08:00Z","pushed_at":"2018-09-07T10:07:19Z","git_url":"git://github.com/eJourn-al/eJournal.git","ssh_url":"git@github.com:eJourn-al/eJournal.git","clone_url":"https://github.com/eJourn-al/eJournal.git","svn_url":"https://github.com/eJourn-al/eJournal","homepage":"","size":22246,"stargazers_count":9,"watchers_count":9,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":53,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":0,"open_issues":53,"watchers":9,"default_branch":"develop"}},"base":{"label":"eJourn-al:develop","ref":"develop","sha":"328f19b4999405ada72267657444f4b97c12cfaf","user":{"login":"eJourn-al","id":41028230,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDI4MjMw","avatar_url":"https://avatars3.githubusercontent.com/u/41028230?v=4","gravatar_id":"","url":"https://api.github.com/users/eJourn-al","html_url":"https://github.com/eJourn-al","followers_url":"https://api.github.com/users/eJourn-al/followers","following_url":"https://api.github.com/users/eJourn-al/following{/other_user}","gists_url":"https://api.github.com/users/eJourn-al/gists{/gist_id}","starred_url":"https://api.github.com/users/eJourn-al/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eJourn-al/subscriptions","organizations_url":"https://api.github.com/users/eJourn-al/orgs","repos_url":"https://api.github.com/users/eJourn-al/repos","events_url":"https://api.github.com/users/eJourn-al/events{/privacy}","received_events_url":"https://api.github.com/users/eJourn-al/received_events","type":"Organization","site_admin":false},"repo":{"id":136030378,"node_id":"MDEwOlJlcG9zaXRvcnkxMzYwMzAzNzg=","name":"eJournal","full_name":"eJourn-al/eJournal","owner":{"login":"eJourn-al","id":41028230,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDI4MjMw","avatar_url":"https://avatars3.githubusercontent.com/u/41028230?v=4","gravatar_id":"","url":"https://api.github.com/users/eJourn-al","html_url":"https://github.com/eJourn-al","followers_url":"https://api.github.com/users/eJourn-al/followers","following_url":"https://api.github.com/users/eJourn-al/following{/other_user}","gists_url":"https://api.github.com/users/eJourn-al/gists{/gist_id}","starred_url":"https://api.github.com/users/eJourn-al/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eJourn-al/subscriptions","organizations_url":"https://api.github.com/users/eJourn-al/orgs","repos_url":"https://api.github.com/users/eJourn-al/repos","events_url":"https://api.github.com/users/eJourn-al/events{/privacy}","received_events_url":"https://api.github.com/users/eJourn-al/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/eJourn-al/eJournal","description":"Platform for long term assignments in virtual learning environments.","fork":false,"url":"https://api.github.com/repos/eJourn-al/eJournal","forks_url":"https://api.github.com/repos/eJourn-al/eJournal/forks","keys_url":"https://api.github.com/repos/eJourn-al/eJournal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eJourn-al/eJournal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eJourn-al/eJournal/teams","hooks_url":"https://api.github.com/repos/eJourn-al/eJournal/hooks","issue_events_url":"https://api.github.com/repos/eJourn-al/eJournal/issues/events{/number}","events_url":"https://api.github.com/repos/eJourn-al/eJournal/events","assignees_url":"https://api.github.com/repos/eJourn-al/eJournal/assignees{/user}","branches_url":"https://api.github.com/repos/eJourn-al/eJournal/branches{/branch}","tags_url":"https://api.github.com/repos/eJourn-al/eJournal/tags","blobs_url":"https://api.github.com/repos/eJourn-al/eJournal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eJourn-al/eJournal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eJourn-al/eJournal/git/refs{/sha}","trees_url":"https://api.github.com/repos/eJourn-al/eJournal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eJourn-al/eJournal/statuses/{sha}","languages_url":"https://api.github.com/repos/eJourn-al/eJournal/languages","stargazers_url":"https://api.github.com/repos/eJourn-al/eJournal/stargazers","contributors_url":"https://api.github.com/repos/eJourn-al/eJournal/contributors","subscribers_url":"https://api.github.com/repos/eJourn-al/eJournal/subscribers","subscription_url":"https://api.github.com/repos/eJourn-al/eJournal/subscription","commits_url":"https://api.github.com/repos/eJourn-al/eJournal/commits{/sha}","git_commits_url":"https://api.github.com/repos/eJourn-al/eJournal/git/commits{/sha}","comments_url":"https://api.github.com/repos/eJourn-al/eJournal/comments{/number}","issue_comment_url":"https://api.github.com/repos/eJourn-al/eJournal/issues/comments{/number}","contents_url":"https://api.github.com/repos/eJourn-al/eJournal/contents/{+path}","compare_url":"https://api.github.com/repos/eJourn-al/eJournal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eJourn-al/eJournal/merges","archive_url":"https://api.github.com/repos/eJourn-al/eJournal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eJourn-al/eJournal/downloads","issues_url":"https://api.github.com/repos/eJourn-al/eJournal/issues{/number}","pulls_url":"https://api.github.com/repos/eJourn-al/eJournal/pulls{/number}","milestones_url":"https://api.github.com/repos/eJourn-al/eJournal/milestones{/number}","notifications_url":"https://api.github.com/repos/eJourn-al/eJournal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eJourn-al/eJournal/labels{/name}","releases_url":"https://api.github.com/repos/eJourn-al/eJournal/releases{/id}","deployments_url":"https://api.github.com/repos/eJourn-al/eJournal/deployments","created_at":"2018-06-04T13:36:31Z","updated_at":"2018-09-06T22:08:00Z","pushed_at":"2018-09-07T10:07:19Z","git_url":"git://github.com/eJourn-al/eJournal.git","ssh_url":"git@github.com:eJourn-al/eJournal.git","clone_url":"https://github.com/eJourn-al/eJournal.git","svn_url":"https://github.com/eJourn-al/eJournal","homepage":"","size":22246,"stargazers_count":9,"watchers_count":9,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":53,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":0,"open_issues":53,"watchers":9,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/eJourn-al/eJournal/pulls/283"},"html":{"href":"https://github.com/eJourn-al/eJournal/pull/283"},"issue":{"href":"https://api.github.com/repos/eJourn-al/eJournal/issues/283"},"comments":{"href":"https://api.github.com/repos/eJourn-al/eJournal/issues/283/comments"},"review_comments":{"href":"https://api.github.com/repos/eJourn-al/eJournal/pulls/283/comments"},"review_comment":{"href":"https://api.github.com/repos/eJourn-al/eJournal/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/eJourn-al/eJournal/pulls/283/commits"},"statuses":{"href":"https://api.github.com/repos/eJourn-al/eJournal/statuses/21e405fe33f0bbb20c8f8961c3f7c0edd4f7805f"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"Larspolo"}}