{"action":"created","comment":{"url":"https://api.github.com/repos/eduNEXT/eox-tenant/pulls/comments/359431719","pull_request_review_id":334084712,"id":359431719,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDM1OTQzMTcxOQ==","diff_hunk":"@@ -160,3 +163,62 @@ def set_key_to_cache(cls, key, value):\n             value,\n             EOX_TENANT_CACHE_KEY_TIMEOUT\n         )\n+\n+\n+class TenantCertificateManager(models.Manager):\n+    \"\"\"\n+    Custom Manager Class that allows to override the get_queryset\n+    method in order to filter the results by org.\n+    \"\"\"\n+\n+    def get_queryset(self):\n+        \"\"\"\n+        Call parent method and filter the certificates by org.\n+        \"\"\"\n+        generated_certificates = super(TenantCertificateManager, self).get_queryset()\n+        excluded_courses = [\n+            certificate.course_id\n+            for certificate in generated_certificates\n+            if certificate.course_id.org not in getattr(settings, \"course_org_filter\", [])","path":"eox_tenant/tenant_wise/proxies.py","position":44,"original_position":44,"commit_id":"a0d319dbb8fb1d2824d07f1a39500ae6e5593423","original_commit_id":"a0d319dbb8fb1d2824d07f1a39500ae6e5593423","user":{"login":"morenol","id":22335041,"node_id":"MDQ6VXNlcjIyMzM1MDQx","avatar_url":"https://avatars2.githubusercontent.com/u/22335041?v=4","gravatar_id":"","url":"https://api.github.com/users/morenol","html_url":"https://github.com/morenol","followers_url":"https://api.github.com/users/morenol/followers","following_url":"https://api.github.com/users/morenol/following{/other_user}","gists_url":"https://api.github.com/users/morenol/gists{/gist_id}","starred_url":"https://api.github.com/users/morenol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/morenol/subscriptions","organizations_url":"https://api.github.com/users/morenol/orgs","repos_url":"https://api.github.com/users/morenol/repos","events_url":"https://api.github.com/users/morenol/events{/privacy}","received_events_url":"https://api.github.com/users/morenol/received_events","type":"User","site_admin":false},"body":"I think that we should create a function that returns\r\n\r\ngetattr(settings, key)\r\n\r\nIf we do that we can differentiate the times when we want to get a value for the current tenant with the times when we want to get general django setting. ","created_at":"2019-12-18T16:08:35Z","updated_at":"2019-12-18T16:08:36Z","html_url":"https://github.com/eduNEXT/eox-tenant/pull/62#discussion_r359431719","pull_request_url":"https://api.github.com/repos/eduNEXT/eox-tenant/pulls/62","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/eduNEXT/eox-tenant/pulls/comments/359431719"},"html":{"href":"https://github.com/eduNEXT/eox-tenant/pull/62#discussion_r359431719"},"pull_request":{"href":"https://api.github.com/repos/eduNEXT/eox-tenant/pulls/62"}}},"pull_request":{"url":"https://api.github.com/repos/eduNEXT/eox-tenant/pulls/62","id":352634859,"node_id":"MDExOlB1bGxSZXF1ZXN0MzUyNjM0ODU5","html_url":"https://github.com/eduNEXT/eox-tenant/pull/62","diff_url":"https://github.com/eduNEXT/eox-tenant/pull/62.diff","patch_url":"https://github.com/eduNEXT/eox-tenant/pull/62.patch","issue_url":"https://api.github.com/repos/eduNEXT/eox-tenant/issues/62","number":62,"state":"open","locked":false,"title":"Make certificates tenant aware.","user":{"login":"andrey-canon","id":36200299,"node_id":"MDQ6VXNlcjM2MjAwMjk5","avatar_url":"https://avatars2.githubusercontent.com/u/36200299?v=4","gravatar_id":"","url":"https://api.github.com/users/andrey-canon","html_url":"https://github.com/andrey-canon","followers_url":"https://api.github.com/users/andrey-canon/followers","following_url":"https://api.github.com/users/andrey-canon/following{/other_user}","gists_url":"https://api.github.com/users/andrey-canon/gists{/gist_id}","starred_url":"https://api.github.com/users/andrey-canon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrey-canon/subscriptions","organizations_url":"https://api.github.com/users/andrey-canon/orgs","repos_url":"https://api.github.com/users/andrey-canon/repos","events_url":"https://api.github.com/users/andrey-canon/events{/privacy}","received_events_url":"https://api.github.com/users/andrey-canon/received_events","type":"User","site_admin":false},"body":"## Description.\r\nThis allows to override the model GeneratedCertificates model, using monkey patch in order to filter the certificates by org.","created_at":"2019-12-12T22:14:13Z","updated_at":"2019-12-18T16:08:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7eecb313532bf6f85a3be5a5282e85fbf9df8f29","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/eduNEXT/eox-tenant/pulls/62/commits","review_comments_url":"https://api.github.com/repos/eduNEXT/eox-tenant/pulls/62/comments","review_comment_url":"https://api.github.com/repos/eduNEXT/eox-tenant/pulls/comments{/number}","comments_url":"https://api.github.com/repos/eduNEXT/eox-tenant/issues/62/comments","statuses_url":"https://api.github.com/repos/eduNEXT/eox-tenant/statuses/a0d319dbb8fb1d2824d07f1a39500ae6e5593423","head":{"label":"eduNEXT:and/add_certificates_proxy","ref":"and/add_certificates_proxy","sha":"a0d319dbb8fb1d2824d07f1a39500ae6e5593423","user":{"login":"eduNEXT","id":5911140,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU5MTExNDA=","avatar_url":"https://avatars0.githubusercontent.com/u/5911140?v=4","gravatar_id":"","url":"https://api.github.com/users/eduNEXT","html_url":"https://github.com/eduNEXT","followers_url":"https://api.github.com/users/eduNEXT/followers","following_url":"https://api.github.com/users/eduNEXT/following{/other_user}","gists_url":"https://api.github.com/users/eduNEXT/gists{/gist_id}","starred_url":"https://api.github.com/users/eduNEXT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eduNEXT/subscriptions","organizations_url":"https://api.github.com/users/eduNEXT/orgs","repos_url":"https://api.github.com/users/eduNEXT/repos","events_url":"https://api.github.com/users/eduNEXT/events{/privacy}","received_events_url":"https://api.github.com/users/eduNEXT/received_events","type":"Organization","site_admin":false},"repo":{"id":156419696,"node_id":"MDEwOlJlcG9zaXRvcnkxNTY0MTk2OTY=","name":"eox-tenant","full_name":"eduNEXT/eox-tenant","private":false,"owner":{"login":"eduNEXT","id":5911140,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU5MTExNDA=","avatar_url":"https://avatars0.githubusercontent.com/u/5911140?v=4","gravatar_id":"","url":"https://api.github.com/users/eduNEXT","html_url":"https://github.com/eduNEXT","followers_url":"https://api.github.com/users/eduNEXT/followers","following_url":"https://api.github.com/users/eduNEXT/following{/other_user}","gists_url":"https://api.github.com/users/eduNEXT/gists{/gist_id}","starred_url":"https://api.github.com/users/eduNEXT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eduNEXT/subscriptions","organizations_url":"https://api.github.com/users/eduNEXT/orgs","repos_url":"https://api.github.com/users/eduNEXT/repos","events_url":"https://api.github.com/users/eduNEXT/events{/privacy}","received_events_url":"https://api.github.com/users/eduNEXT/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/eduNEXT/eox-tenant","description":null,"fork":false,"url":"https://api.github.com/repos/eduNEXT/eox-tenant","forks_url":"https://api.github.com/repos/eduNEXT/eox-tenant/forks","keys_url":"https://api.github.com/repos/eduNEXT/eox-tenant/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eduNEXT/eox-tenant/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eduNEXT/eox-tenant/teams","hooks_url":"https://api.github.com/repos/eduNEXT/eox-tenant/hooks","issue_events_url":"https://api.github.com/repos/eduNEXT/eox-tenant/issues/events{/number}","events_url":"https://api.github.com/repos/eduNEXT/eox-tenant/events","assignees_url":"https://api.github.com/repos/eduNEXT/eox-tenant/assignees{/user}","branches_url":"https://api.github.com/repos/eduNEXT/eox-tenant/branches{/branch}","tags_url":"https://api.github.com/repos/eduNEXT/eox-tenant/tags","blobs_url":"https://api.github.com/repos/eduNEXT/eox-tenant/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eduNEXT/eox-tenant/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eduNEXT/eox-tenant/git/refs{/sha}","trees_url":"https://api.github.com/repos/eduNEXT/eox-tenant/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eduNEXT/eox-tenant/statuses/{sha}","languages_url":"https://api.github.com/repos/eduNEXT/eox-tenant/languages","stargazers_url":"https://api.github.com/repos/eduNEXT/eox-tenant/stargazers","contributors_url":"https://api.github.com/repos/eduNEXT/eox-tenant/contributors","subscribers_url":"https://api.github.com/repos/eduNEXT/eox-tenant/subscribers","subscription_url":"https://api.github.com/repos/eduNEXT/eox-tenant/subscription","commits_url":"https://api.github.com/repos/eduNEXT/eox-tenant/commits{/sha}","git_commits_url":"https://api.github.com/repos/eduNEXT/eox-tenant/git/commits{/sha}","comments_url":"https://api.github.com/repos/eduNEXT/eox-tenant/comments{/number}","issue_comment_url":"https://api.github.com/repos/eduNEXT/eox-tenant/issues/comments{/number}","contents_url":"https://api.github.com/repos/eduNEXT/eox-tenant/contents/{+path}","compare_url":"https://api.github.com/repos/eduNEXT/eox-tenant/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eduNEXT/eox-tenant/merges","archive_url":"https://api.github.com/repos/eduNEXT/eox-tenant/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eduNEXT/eox-tenant/downloads","issues_url":"https://api.github.com/repos/eduNEXT/eox-tenant/issues{/number}","pulls_url":"https://api.github.com/repos/eduNEXT/eox-tenant/pulls{/number}","milestones_url":"https://api.github.com/repos/eduNEXT/eox-tenant/milestones{/number}","notifications_url":"https://api.github.com/repos/eduNEXT/eox-tenant/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eduNEXT/eox-tenant/labels{/name}","releases_url":"https://api.github.com/repos/eduNEXT/eox-tenant/releases{/id}","deployments_url":"https://api.github.com/repos/eduNEXT/eox-tenant/deployments","created_at":"2018-11-06T17:15:09Z","updated_at":"2019-12-16T14:25:49Z","pushed_at":"2019-12-16T21:58:05Z","git_url":"git://github.com/eduNEXT/eox-tenant.git","ssh_url":"git@github.com:eduNEXT/eox-tenant.git","clone_url":"https://github.com/eduNEXT/eox-tenant.git","svn_url":"https://github.com/eduNEXT/eox-tenant","homepage":null,"size":229,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":4,"license":null,"forks":1,"open_issues":4,"watchers":1,"default_branch":"master"}},"base":{"label":"eduNEXT:master","ref":"master","sha":"d53936973823d304a67a276e2568893b5a548d3a","user":{"login":"eduNEXT","id":5911140,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU5MTExNDA=","avatar_url":"https://avatars0.githubusercontent.com/u/5911140?v=4","gravatar_id":"","url":"https://api.github.com/users/eduNEXT","html_url":"https://github.com/eduNEXT","followers_url":"https://api.github.com/users/eduNEXT/followers","following_url":"https://api.github.com/users/eduNEXT/following{/other_user}","gists_url":"https://api.github.com/users/eduNEXT/gists{/gist_id}","starred_url":"https://api.github.com/users/eduNEXT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eduNEXT/subscriptions","organizations_url":"https://api.github.com/users/eduNEXT/orgs","repos_url":"https://api.github.com/users/eduNEXT/repos","events_url":"https://api.github.com/users/eduNEXT/events{/privacy}","received_events_url":"https://api.github.com/users/eduNEXT/received_events","type":"Organization","site_admin":false},"repo":{"id":156419696,"node_id":"MDEwOlJlcG9zaXRvcnkxNTY0MTk2OTY=","name":"eox-tenant","full_name":"eduNEXT/eox-tenant","private":false,"owner":{"login":"eduNEXT","id":5911140,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU5MTExNDA=","avatar_url":"https://avatars0.githubusercontent.com/u/5911140?v=4","gravatar_id":"","url":"https://api.github.com/users/eduNEXT","html_url":"https://github.com/eduNEXT","followers_url":"https://api.github.com/users/eduNEXT/followers","following_url":"https://api.github.com/users/eduNEXT/following{/other_user}","gists_url":"https://api.github.com/users/eduNEXT/gists{/gist_id}","starred_url":"https://api.github.com/users/eduNEXT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eduNEXT/subscriptions","organizations_url":"https://api.github.com/users/eduNEXT/orgs","repos_url":"https://api.github.com/users/eduNEXT/repos","events_url":"https://api.github.com/users/eduNEXT/events{/privacy}","received_events_url":"https://api.github.com/users/eduNEXT/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/eduNEXT/eox-tenant","description":null,"fork":false,"url":"https://api.github.com/repos/eduNEXT/eox-tenant","forks_url":"https://api.github.com/repos/eduNEXT/eox-tenant/forks","keys_url":"https://api.github.com/repos/eduNEXT/eox-tenant/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eduNEXT/eox-tenant/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eduNEXT/eox-tenant/teams","hooks_url":"https://api.github.com/repos/eduNEXT/eox-tenant/hooks","issue_events_url":"https://api.github.com/repos/eduNEXT/eox-tenant/issues/events{/number}","events_url":"https://api.github.com/repos/eduNEXT/eox-tenant/events","assignees_url":"https://api.github.com/repos/eduNEXT/eox-tenant/assignees{/user}","branches_url":"https://api.github.com/repos/eduNEXT/eox-tenant/branches{/branch}","tags_url":"https://api.github.com/repos/eduNEXT/eox-tenant/tags","blobs_url":"https://api.github.com/repos/eduNEXT/eox-tenant/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eduNEXT/eox-tenant/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eduNEXT/eox-tenant/git/refs{/sha}","trees_url":"https://api.github.com/repos/eduNEXT/eox-tenant/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eduNEXT/eox-tenant/statuses/{sha}","languages_url":"https://api.github.com/repos/eduNEXT/eox-tenant/languages","stargazers_url":"https://api.github.com/repos/eduNEXT/eox-tenant/stargazers","contributors_url":"https://api.github.com/repos/eduNEXT/eox-tenant/contributors","subscribers_url":"https://api.github.com/repos/eduNEXT/eox-tenant/subscribers","subscription_url":"https://api.github.com/repos/eduNEXT/eox-tenant/subscription","commits_url":"https://api.github.com/repos/eduNEXT/eox-tenant/commits{/sha}","git_commits_url":"https://api.github.com/repos/eduNEXT/eox-tenant/git/commits{/sha}","comments_url":"https://api.github.com/repos/eduNEXT/eox-tenant/comments{/number}","issue_comment_url":"https://api.github.com/repos/eduNEXT/eox-tenant/issues/comments{/number}","contents_url":"https://api.github.com/repos/eduNEXT/eox-tenant/contents/{+path}","compare_url":"https://api.github.com/repos/eduNEXT/eox-tenant/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eduNEXT/eox-tenant/merges","archive_url":"https://api.github.com/repos/eduNEXT/eox-tenant/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eduNEXT/eox-tenant/downloads","issues_url":"https://api.github.com/repos/eduNEXT/eox-tenant/issues{/number}","pulls_url":"https://api.github.com/repos/eduNEXT/eox-tenant/pulls{/number}","milestones_url":"https://api.github.com/repos/eduNEXT/eox-tenant/milestones{/number}","notifications_url":"https://api.github.com/repos/eduNEXT/eox-tenant/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eduNEXT/eox-tenant/labels{/name}","releases_url":"https://api.github.com/repos/eduNEXT/eox-tenant/releases{/id}","deployments_url":"https://api.github.com/repos/eduNEXT/eox-tenant/deployments","created_at":"2018-11-06T17:15:09Z","updated_at":"2019-12-16T14:25:49Z","pushed_at":"2019-12-16T21:58:05Z","git_url":"git://github.com/eduNEXT/eox-tenant.git","ssh_url":"git@github.com:eduNEXT/eox-tenant.git","clone_url":"https://github.com/eduNEXT/eox-tenant.git","svn_url":"https://github.com/eduNEXT/eox-tenant","homepage":null,"size":229,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":4,"license":null,"forks":1,"open_issues":4,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/eduNEXT/eox-tenant/pulls/62"},"html":{"href":"https://github.com/eduNEXT/eox-tenant/pull/62"},"issue":{"href":"https://api.github.com/repos/eduNEXT/eox-tenant/issues/62"},"comments":{"href":"https://api.github.com/repos/eduNEXT/eox-tenant/issues/62/comments"},"review_comments":{"href":"https://api.github.com/repos/eduNEXT/eox-tenant/pulls/62/comments"},"review_comment":{"href":"https://api.github.com/repos/eduNEXT/eox-tenant/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/eduNEXT/eox-tenant/pulls/62/commits"},"statuses":{"href":"https://api.github.com/repos/eduNEXT/eox-tenant/statuses/a0d319dbb8fb1d2824d07f1a39500ae6e5593423"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"morenol"}}