{"action":"created","comment":{"url":"https://api.github.com/repos/jundymek/site-down-checker/pulls/comments/240058474","pull_request_review_id":183000256,"id":240058474,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MDA1ODQ3NA==","diff_hunk":"@@ -0,0 +1,147 @@\n+import requests\n+import json\n+from datetime import datetime\n+from constance import config\n+from proxy_requests.proxy_requests import ProxyRequests\n+\n+from django.core.mail import send_mail\n+from django.conf import settings\n+from django.contrib.auth.models import User\n+from django.contrib import messages\n+\n+from .models import SiteToCheck\n+\n+\n+def send_email(message, email):\n+    subject = 'Errors on my pages'\n+    message = message\n+    from_email = settings.EMAIL_ADDRESS\n+    to_email = email\n+    send_mail(\n+        subject,\n+        message,\n+        from_email,\n+        [to_email],\n+        fail_silently=False,\n+    )\n+\n+\n+def my_cron_job():\n+    users = User.objects.all()","path":"main/calculations.py","position":30,"original_position":30,"commit_id":"5a912ae81d0063df7765df8534594d2680bee691","original_commit_id":"5a912ae81d0063df7765df8534594d2680bee691","user":{"login":"jundymek","id":24244872,"node_id":"MDQ6VXNlcjI0MjQ0ODcy","avatar_url":"https://avatars1.githubusercontent.com/u/24244872?v=4","gravatar_id":"","url":"https://api.github.com/users/jundymek","html_url":"https://github.com/jundymek","followers_url":"https://api.github.com/users/jundymek/followers","following_url":"https://api.github.com/users/jundymek/following{/other_user}","gists_url":"https://api.github.com/users/jundymek/gists{/gist_id}","starred_url":"https://api.github.com/users/jundymek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jundymek/subscriptions","organizations_url":"https://api.github.com/users/jundymek/orgs","repos_url":"https://api.github.com/users/jundymek/repos","events_url":"https://api.github.com/users/jundymek/events{/privacy}","received_events_url":"https://api.github.com/users/jundymek/received_events","type":"User","site_admin":false},"body":"Myślałem nad tym i raczej prefetch_related nie da się tutaj zastosować. Muszę iterować po userach i po stronach, bo dla każdego usera z osobna tworzę zmienną `output` i wysyłam maila `        if output:\r\n            send_email(output, user.email)`","created_at":"2018-12-09T23:13:20Z","updated_at":"2018-12-09T23:13:20Z","html_url":"https://github.com/jundymek/site-down-checker/pull/2#discussion_r240058474","pull_request_url":"https://api.github.com/repos/jundymek/site-down-checker/pulls/2","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/jundymek/site-down-checker/pulls/comments/240058474"},"html":{"href":"https://github.com/jundymek/site-down-checker/pull/2#discussion_r240058474"},"pull_request":{"href":"https://api.github.com/repos/jundymek/site-down-checker/pulls/2"}},"in_reply_to_id":236432767},"pull_request":{"url":"https://api.github.com/repos/jundymek/site-down-checker/pulls/2","id":233693321,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzNjkzMzIx","html_url":"https://github.com/jundymek/site-down-checker/pull/2","diff_url":"https://github.com/jundymek/site-down-checker/pull/2.diff","patch_url":"https://github.com/jundymek/site-down-checker/pull/2.patch","issue_url":"https://api.github.com/repos/jundymek/site-down-checker/issues/2","number":2,"state":"open","locked":false,"title":"Cbv","user":{"login":"jundymek","id":24244872,"node_id":"MDQ6VXNlcjI0MjQ0ODcy","avatar_url":"https://avatars1.githubusercontent.com/u/24244872?v=4","gravatar_id":"","url":"https://api.github.com/users/jundymek","html_url":"https://github.com/jundymek","followers_url":"https://api.github.com/users/jundymek/followers","following_url":"https://api.github.com/users/jundymek/following{/other_user}","gists_url":"https://api.github.com/users/jundymek/gists{/gist_id}","starred_url":"https://api.github.com/users/jundymek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jundymek/subscriptions","organizations_url":"https://api.github.com/users/jundymek/orgs","repos_url":"https://api.github.com/users/jundymek/repos","events_url":"https://api.github.com/users/jundymek/events{/privacy}","received_events_url":"https://api.github.com/users/jundymek/received_events","type":"User","site_admin":false},"body":"One more time","created_at":"2018-11-26T20:54:31Z","updated_at":"2018-12-09T23:13:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":{"login":"jundymek","id":24244872,"node_id":"MDQ6VXNlcjI0MjQ0ODcy","avatar_url":"https://avatars1.githubusercontent.com/u/24244872?v=4","gravatar_id":"","url":"https://api.github.com/users/jundymek","html_url":"https://github.com/jundymek","followers_url":"https://api.github.com/users/jundymek/followers","following_url":"https://api.github.com/users/jundymek/following{/other_user}","gists_url":"https://api.github.com/users/jundymek/gists{/gist_id}","starred_url":"https://api.github.com/users/jundymek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jundymek/subscriptions","organizations_url":"https://api.github.com/users/jundymek/orgs","repos_url":"https://api.github.com/users/jundymek/repos","events_url":"https://api.github.com/users/jundymek/events{/privacy}","received_events_url":"https://api.github.com/users/jundymek/received_events","type":"User","site_admin":false},"assignees":[{"login":"jundymek","id":24244872,"node_id":"MDQ6VXNlcjI0MjQ0ODcy","avatar_url":"https://avatars1.githubusercontent.com/u/24244872?v=4","gravatar_id":"","url":"https://api.github.com/users/jundymek","html_url":"https://github.com/jundymek","followers_url":"https://api.github.com/users/jundymek/followers","following_url":"https://api.github.com/users/jundymek/following{/other_user}","gists_url":"https://api.github.com/users/jundymek/gists{/gist_id}","starred_url":"https://api.github.com/users/jundymek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jundymek/subscriptions","organizations_url":"https://api.github.com/users/jundymek/orgs","repos_url":"https://api.github.com/users/jundymek/repos","events_url":"https://api.github.com/users/jundymek/events{/privacy}","received_events_url":"https://api.github.com/users/jundymek/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/jundymek/site-down-checker/pulls/2/commits","review_comments_url":"https://api.github.com/repos/jundymek/site-down-checker/pulls/2/comments","review_comment_url":"https://api.github.com/repos/jundymek/site-down-checker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jundymek/site-down-checker/issues/2/comments","statuses_url":"https://api.github.com/repos/jundymek/site-down-checker/statuses/5a912ae81d0063df7765df8534594d2680bee691","head":{"label":"jundymek:CBV","ref":"CBV","sha":"5a912ae81d0063df7765df8534594d2680bee691","user":{"login":"jundymek","id":24244872,"node_id":"MDQ6VXNlcjI0MjQ0ODcy","avatar_url":"https://avatars1.githubusercontent.com/u/24244872?v=4","gravatar_id":"","url":"https://api.github.com/users/jundymek","html_url":"https://github.com/jundymek","followers_url":"https://api.github.com/users/jundymek/followers","following_url":"https://api.github.com/users/jundymek/following{/other_user}","gists_url":"https://api.github.com/users/jundymek/gists{/gist_id}","starred_url":"https://api.github.com/users/jundymek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jundymek/subscriptions","organizations_url":"https://api.github.com/users/jundymek/orgs","repos_url":"https://api.github.com/users/jundymek/repos","events_url":"https://api.github.com/users/jundymek/events{/privacy}","received_events_url":"https://api.github.com/users/jundymek/received_events","type":"User","site_admin":false},"repo":{"id":145756200,"node_id":"MDEwOlJlcG9zaXRvcnkxNDU3NTYyMDA=","name":"site-down-checker","full_name":"jundymek/site-down-checker","private":false,"owner":{"login":"jundymek","id":24244872,"node_id":"MDQ6VXNlcjI0MjQ0ODcy","avatar_url":"https://avatars1.githubusercontent.com/u/24244872?v=4","gravatar_id":"","url":"https://api.github.com/users/jundymek","html_url":"https://github.com/jundymek","followers_url":"https://api.github.com/users/jundymek/followers","following_url":"https://api.github.com/users/jundymek/following{/other_user}","gists_url":"https://api.github.com/users/jundymek/gists{/gist_id}","starred_url":"https://api.github.com/users/jundymek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jundymek/subscriptions","organizations_url":"https://api.github.com/users/jundymek/orgs","repos_url":"https://api.github.com/users/jundymek/repos","events_url":"https://api.github.com/users/jundymek/events{/privacy}","received_events_url":"https://api.github.com/users/jundymek/received_events","type":"User","site_admin":false},"html_url":"https://github.com/jundymek/site-down-checker","description":"A simple web application to monitor HTTP statuses of your websites.","fork":false,"url":"https://api.github.com/repos/jundymek/site-down-checker","forks_url":"https://api.github.com/repos/jundymek/site-down-checker/forks","keys_url":"https://api.github.com/repos/jundymek/site-down-checker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jundymek/site-down-checker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jundymek/site-down-checker/teams","hooks_url":"https://api.github.com/repos/jundymek/site-down-checker/hooks","issue_events_url":"https://api.github.com/repos/jundymek/site-down-checker/issues/events{/number}","events_url":"https://api.github.com/repos/jundymek/site-down-checker/events","assignees_url":"https://api.github.com/repos/jundymek/site-down-checker/assignees{/user}","branches_url":"https://api.github.com/repos/jundymek/site-down-checker/branches{/branch}","tags_url":"https://api.github.com/repos/jundymek/site-down-checker/tags","blobs_url":"https://api.github.com/repos/jundymek/site-down-checker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jundymek/site-down-checker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jundymek/site-down-checker/git/refs{/sha}","trees_url":"https://api.github.com/repos/jundymek/site-down-checker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jundymek/site-down-checker/statuses/{sha}","languages_url":"https://api.github.com/repos/jundymek/site-down-checker/languages","stargazers_url":"https://api.github.com/repos/jundymek/site-down-checker/stargazers","contributors_url":"https://api.github.com/repos/jundymek/site-down-checker/contributors","subscribers_url":"https://api.github.com/repos/jundymek/site-down-checker/subscribers","subscription_url":"https://api.github.com/repos/jundymek/site-down-checker/subscription","commits_url":"https://api.github.com/repos/jundymek/site-down-checker/commits{/sha}","git_commits_url":"https://api.github.com/repos/jundymek/site-down-checker/git/commits{/sha}","comments_url":"https://api.github.com/repos/jundymek/site-down-checker/comments{/number}","issue_comment_url":"https://api.github.com/repos/jundymek/site-down-checker/issues/comments{/number}","contents_url":"https://api.github.com/repos/jundymek/site-down-checker/contents/{+path}","compare_url":"https://api.github.com/repos/jundymek/site-down-checker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jundymek/site-down-checker/merges","archive_url":"https://api.github.com/repos/jundymek/site-down-checker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jundymek/site-down-checker/downloads","issues_url":"https://api.github.com/repos/jundymek/site-down-checker/issues{/number}","pulls_url":"https://api.github.com/repos/jundymek/site-down-checker/pulls{/number}","milestones_url":"https://api.github.com/repos/jundymek/site-down-checker/milestones{/number}","notifications_url":"https://api.github.com/repos/jundymek/site-down-checker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jundymek/site-down-checker/labels{/name}","releases_url":"https://api.github.com/repos/jundymek/site-down-checker/releases{/id}","deployments_url":"https://api.github.com/repos/jundymek/site-down-checker/deployments","created_at":"2018-08-22T19:55:46Z","updated_at":"2018-10-20T21:52:48Z","pushed_at":"2018-11-27T22:10:03Z","git_url":"git://github.com/jundymek/site-down-checker.git","ssh_url":"git@github.com:jundymek/site-down-checker.git","clone_url":"https://github.com/jundymek/site-down-checker.git","svn_url":"https://github.com/jundymek/site-down-checker","homepage":"","size":1160,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"jundymek:code_review_CBV","ref":"code_review_CBV","sha":"c587176c42f8ef78150994f53530b5ab73a074d9","user":{"login":"jundymek","id":24244872,"node_id":"MDQ6VXNlcjI0MjQ0ODcy","avatar_url":"https://avatars1.githubusercontent.com/u/24244872?v=4","gravatar_id":"","url":"https://api.github.com/users/jundymek","html_url":"https://github.com/jundymek","followers_url":"https://api.github.com/users/jundymek/followers","following_url":"https://api.github.com/users/jundymek/following{/other_user}","gists_url":"https://api.github.com/users/jundymek/gists{/gist_id}","starred_url":"https://api.github.com/users/jundymek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jundymek/subscriptions","organizations_url":"https://api.github.com/users/jundymek/orgs","repos_url":"https://api.github.com/users/jundymek/repos","events_url":"https://api.github.com/users/jundymek/events{/privacy}","received_events_url":"https://api.github.com/users/jundymek/received_events","type":"User","site_admin":false},"repo":{"id":145756200,"node_id":"MDEwOlJlcG9zaXRvcnkxNDU3NTYyMDA=","name":"site-down-checker","full_name":"jundymek/site-down-checker","private":false,"owner":{"login":"jundymek","id":24244872,"node_id":"MDQ6VXNlcjI0MjQ0ODcy","avatar_url":"https://avatars1.githubusercontent.com/u/24244872?v=4","gravatar_id":"","url":"https://api.github.com/users/jundymek","html_url":"https://github.com/jundymek","followers_url":"https://api.github.com/users/jundymek/followers","following_url":"https://api.github.com/users/jundymek/following{/other_user}","gists_url":"https://api.github.com/users/jundymek/gists{/gist_id}","starred_url":"https://api.github.com/users/jundymek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jundymek/subscriptions","organizations_url":"https://api.github.com/users/jundymek/orgs","repos_url":"https://api.github.com/users/jundymek/repos","events_url":"https://api.github.com/users/jundymek/events{/privacy}","received_events_url":"https://api.github.com/users/jundymek/received_events","type":"User","site_admin":false},"html_url":"https://github.com/jundymek/site-down-checker","description":"A simple web application to monitor HTTP statuses of your websites.","fork":false,"url":"https://api.github.com/repos/jundymek/site-down-checker","forks_url":"https://api.github.com/repos/jundymek/site-down-checker/forks","keys_url":"https://api.github.com/repos/jundymek/site-down-checker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jundymek/site-down-checker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jundymek/site-down-checker/teams","hooks_url":"https://api.github.com/repos/jundymek/site-down-checker/hooks","issue_events_url":"https://api.github.com/repos/jundymek/site-down-checker/issues/events{/number}","events_url":"https://api.github.com/repos/jundymek/site-down-checker/events","assignees_url":"https://api.github.com/repos/jundymek/site-down-checker/assignees{/user}","branches_url":"https://api.github.com/repos/jundymek/site-down-checker/branches{/branch}","tags_url":"https://api.github.com/repos/jundymek/site-down-checker/tags","blobs_url":"https://api.github.com/repos/jundymek/site-down-checker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jundymek/site-down-checker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jundymek/site-down-checker/git/refs{/sha}","trees_url":"https://api.github.com/repos/jundymek/site-down-checker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jundymek/site-down-checker/statuses/{sha}","languages_url":"https://api.github.com/repos/jundymek/site-down-checker/languages","stargazers_url":"https://api.github.com/repos/jundymek/site-down-checker/stargazers","contributors_url":"https://api.github.com/repos/jundymek/site-down-checker/contributors","subscribers_url":"https://api.github.com/repos/jundymek/site-down-checker/subscribers","subscription_url":"https://api.github.com/repos/jundymek/site-down-checker/subscription","commits_url":"https://api.github.com/repos/jundymek/site-down-checker/commits{/sha}","git_commits_url":"https://api.github.com/repos/jundymek/site-down-checker/git/commits{/sha}","comments_url":"https://api.github.com/repos/jundymek/site-down-checker/comments{/number}","issue_comment_url":"https://api.github.com/repos/jundymek/site-down-checker/issues/comments{/number}","contents_url":"https://api.github.com/repos/jundymek/site-down-checker/contents/{+path}","compare_url":"https://api.github.com/repos/jundymek/site-down-checker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jundymek/site-down-checker/merges","archive_url":"https://api.github.com/repos/jundymek/site-down-checker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jundymek/site-down-checker/downloads","issues_url":"https://api.github.com/repos/jundymek/site-down-checker/issues{/number}","pulls_url":"https://api.github.com/repos/jundymek/site-down-checker/pulls{/number}","milestones_url":"https://api.github.com/repos/jundymek/site-down-checker/milestones{/number}","notifications_url":"https://api.github.com/repos/jundymek/site-down-checker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jundymek/site-down-checker/labels{/name}","releases_url":"https://api.github.com/repos/jundymek/site-down-checker/releases{/id}","deployments_url":"https://api.github.com/repos/jundymek/site-down-checker/deployments","created_at":"2018-08-22T19:55:46Z","updated_at":"2018-10-20T21:52:48Z","pushed_at":"2018-11-27T22:10:03Z","git_url":"git://github.com/jundymek/site-down-checker.git","ssh_url":"git@github.com:jundymek/site-down-checker.git","clone_url":"https://github.com/jundymek/site-down-checker.git","svn_url":"https://github.com/jundymek/site-down-checker","homepage":"","size":1160,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jundymek/site-down-checker/pulls/2"},"html":{"href":"https://github.com/jundymek/site-down-checker/pull/2"},"issue":{"href":"https://api.github.com/repos/jundymek/site-down-checker/issues/2"},"comments":{"href":"https://api.github.com/repos/jundymek/site-down-checker/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/jundymek/site-down-checker/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/jundymek/site-down-checker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jundymek/site-down-checker/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/jundymek/site-down-checker/statuses/5a912ae81d0063df7765df8534594d2680bee691"}},"author_association":"OWNER"}}
{"actor":{"display_login":"jundymek"}}