{"action":"created","comment":{"url":"https://api.github.com/repos/rmotr/rmotr-sis/pulls/comments/44213417","id":44213417,"diff_hunk":"@@ -0,0 +1,50 @@\n+from __future__ import division, unicode_literals, absolute_import\n+\n+from django.core.urlresolvers import reverse\n+from django.core.management.base import BaseCommand, CommandError\n+\n+from rmotr_sis.utils import send_template_mail\n+from applications.models import Application\n+\n+CONFIG = {\n+    'not-validated-email': {\n+        'template_name': 'reminders/not-validated-email.html',\n+        'subject': '*|FNAME|*, thanks for applying to rmotr.com! Please keep in mind that...',\n+        'filter': {'status': 1, 'email_validated': False},\n+        'next_url': 'applications:application-2'\n+    }\n+}\n+\n+\n+class Command(BaseCommand):\n+    help = 'Sends reminder emails to students based in given configuration'\n+\n+    def add_arguments(self, parser):\n+        parser.add_argument(\n+            'action', help=('Type of reminder to send by email. '\n+                            'Options are: {}'.format(', '.join(CONFIG.keys()))))\n+\n+    def handle(self, *args, **kwargs):\n+        action = kwargs['action']\n+        if action not in CONFIG.keys():\n+            raise CommandError('Invalid action type, please use one of: {}'\n+                               ''.format(', '.join(CONFIG.keys())))\n+\n+        applications = Application.objects.filter(**CONFIG[action]['filter'])","path":"rmotr_sis/applications/management/commands/sendreminderemail.py","position":33,"original_position":33,"commit_id":"f5ed869412c8ebbbb545f94b738a610ff36b4b98","original_commit_id":"f5ed869412c8ebbbb545f94b738a610ff36b4b98","user":{"login":"santiagobasulto","id":872296,"avatar_url":"https://avatars.githubusercontent.com/u/872296?v=3","gravatar_id":"","url":"https://api.github.com/users/santiagobasulto","html_url":"https://github.com/santiagobasulto","followers_url":"https://api.github.com/users/santiagobasulto/followers","following_url":"https://api.github.com/users/santiagobasulto/following{/other_user}","gists_url":"https://api.github.com/users/santiagobasulto/gists{/gist_id}","starred_url":"https://api.github.com/users/santiagobasulto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/santiagobasulto/subscriptions","organizations_url":"https://api.github.com/users/santiagobasulto/orgs","repos_url":"https://api.github.com/users/santiagobasulto/repos","events_url":"https://api.github.com/users/santiagobasulto/events{/privacy}","received_events_url":"https://api.github.com/users/santiagobasulto/received_events","type":"User","site_admin":false},"body":"Lindo","created_at":"2015-11-07T15:31:24Z","updated_at":"2015-11-07T15:31:24Z","html_url":"https://github.com/rmotr/rmotr-sis/pull/65#discussion_r44213417","pull_request_url":"https://api.github.com/repos/rmotr/rmotr-sis/pulls/65","_links":{"self":{"href":"https://api.github.com/repos/rmotr/rmotr-sis/pulls/comments/44213417"},"html":{"href":"https://github.com/rmotr/rmotr-sis/pull/65#discussion_r44213417"},"pull_request":{"href":"https://api.github.com/repos/rmotr/rmotr-sis/pulls/65"}}},"pull_request":{"url":"https://api.github.com/repos/rmotr/rmotr-sis/pulls/65","id":50019783,"html_url":"https://github.com/rmotr/rmotr-sis/pull/65","diff_url":"https://github.com/rmotr/rmotr-sis/pull/65.diff","patch_url":"https://github.com/rmotr/rmotr-sis/pull/65.patch","issue_url":"https://api.github.com/repos/rmotr/rmotr-sis/issues/65","number":65,"state":"open","locked":false,"title":"Implement \"sendreminderemails\" command","user":{"login":"martinzugnoni","id":1155573,"avatar_url":"https://avatars.githubusercontent.com/u/1155573?v=3","gravatar_id":"","url":"https://api.github.com/users/martinzugnoni","html_url":"https://github.com/martinzugnoni","followers_url":"https://api.github.com/users/martinzugnoni/followers","following_url":"https://api.github.com/users/martinzugnoni/following{/other_user}","gists_url":"https://api.github.com/users/martinzugnoni/gists{/gist_id}","starred_url":"https://api.github.com/users/martinzugnoni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinzugnoni/subscriptions","organizations_url":"https://api.github.com/users/martinzugnoni/orgs","repos_url":"https://api.github.com/users/martinzugnoni/repos","events_url":"https://api.github.com/users/martinzugnoni/events{/privacy}","received_events_url":"https://api.github.com/users/martinzugnoni/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-07T00:00:54Z","updated_at":"2015-11-07T15:31:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"38844c43b7fc8fa5895c2332b682134b97ee9d3a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rmotr/rmotr-sis/pulls/65/commits","review_comments_url":"https://api.github.com/repos/rmotr/rmotr-sis/pulls/65/comments","review_comment_url":"https://api.github.com/repos/rmotr/rmotr-sis/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rmotr/rmotr-sis/issues/65/comments","statuses_url":"https://api.github.com/repos/rmotr/rmotr-sis/statuses/f5ed869412c8ebbbb545f94b738a610ff36b4b98","head":{"label":"rmotr:reminder-emails","ref":"reminder-emails","sha":"f5ed869412c8ebbbb545f94b738a610ff36b4b98","user":{"login":"rmotr","id":10223902,"avatar_url":"https://avatars.githubusercontent.com/u/10223902?v=3","gravatar_id":"","url":"https://api.github.com/users/rmotr","html_url":"https://github.com/rmotr","followers_url":"https://api.github.com/users/rmotr/followers","following_url":"https://api.github.com/users/rmotr/following{/other_user}","gists_url":"https://api.github.com/users/rmotr/gists{/gist_id}","starred_url":"https://api.github.com/users/rmotr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmotr/subscriptions","organizations_url":"https://api.github.com/users/rmotr/orgs","repos_url":"https://api.github.com/users/rmotr/repos","events_url":"https://api.github.com/users/rmotr/events{/privacy}","received_events_url":"https://api.github.com/users/rmotr/received_events","type":"Organization","site_admin":false},"repo":{"id":31744825,"name":"rmotr-sis","full_name":"rmotr/rmotr-sis","owner":{"login":"rmotr","id":10223902,"avatar_url":"https://avatars.githubusercontent.com/u/10223902?v=3","gravatar_id":"","url":"https://api.github.com/users/rmotr","html_url":"https://github.com/rmotr","followers_url":"https://api.github.com/users/rmotr/followers","following_url":"https://api.github.com/users/rmotr/following{/other_user}","gists_url":"https://api.github.com/users/rmotr/gists{/gist_id}","starred_url":"https://api.github.com/users/rmotr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmotr/subscriptions","organizations_url":"https://api.github.com/users/rmotr/orgs","repos_url":"https://api.github.com/users/rmotr/repos","events_url":"https://api.github.com/users/rmotr/events{/privacy}","received_events_url":"https://api.github.com/users/rmotr/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rmotr/rmotr-sis","description":"Student information system for rmotr.com organization.","fork":false,"url":"https://api.github.com/repos/rmotr/rmotr-sis","forks_url":"https://api.github.com/repos/rmotr/rmotr-sis/forks","keys_url":"https://api.github.com/repos/rmotr/rmotr-sis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rmotr/rmotr-sis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rmotr/rmotr-sis/teams","hooks_url":"https://api.github.com/repos/rmotr/rmotr-sis/hooks","issue_events_url":"https://api.github.com/repos/rmotr/rmotr-sis/issues/events{/number}","events_url":"https://api.github.com/repos/rmotr/rmotr-sis/events","assignees_url":"https://api.github.com/repos/rmotr/rmotr-sis/assignees{/user}","branches_url":"https://api.github.com/repos/rmotr/rmotr-sis/branches{/branch}","tags_url":"https://api.github.com/repos/rmotr/rmotr-sis/tags","blobs_url":"https://api.github.com/repos/rmotr/rmotr-sis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rmotr/rmotr-sis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rmotr/rmotr-sis/git/refs{/sha}","trees_url":"https://api.github.com/repos/rmotr/rmotr-sis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rmotr/rmotr-sis/statuses/{sha}","languages_url":"https://api.github.com/repos/rmotr/rmotr-sis/languages","stargazers_url":"https://api.github.com/repos/rmotr/rmotr-sis/stargazers","contributors_url":"https://api.github.com/repos/rmotr/rmotr-sis/contributors","subscribers_url":"https://api.github.com/repos/rmotr/rmotr-sis/subscribers","subscription_url":"https://api.github.com/repos/rmotr/rmotr-sis/subscription","commits_url":"https://api.github.com/repos/rmotr/rmotr-sis/commits{/sha}","git_commits_url":"https://api.github.com/repos/rmotr/rmotr-sis/git/commits{/sha}","comments_url":"https://api.github.com/repos/rmotr/rmotr-sis/comments{/number}","issue_comment_url":"https://api.github.com/repos/rmotr/rmotr-sis/issues/comments{/number}","contents_url":"https://api.github.com/repos/rmotr/rmotr-sis/contents/{+path}","compare_url":"https://api.github.com/repos/rmotr/rmotr-sis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rmotr/rmotr-sis/merges","archive_url":"https://api.github.com/repos/rmotr/rmotr-sis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rmotr/rmotr-sis/downloads","issues_url":"https://api.github.com/repos/rmotr/rmotr-sis/issues{/number}","pulls_url":"https://api.github.com/repos/rmotr/rmotr-sis/pulls{/number}","milestones_url":"https://api.github.com/repos/rmotr/rmotr-sis/milestones{/number}","notifications_url":"https://api.github.com/repos/rmotr/rmotr-sis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rmotr/rmotr-sis/labels{/name}","releases_url":"https://api.github.com/repos/rmotr/rmotr-sis/releases{/id}","created_at":"2015-03-06T00:43:08Z","updated_at":"2015-09-30T17:56:58Z","pushed_at":"2015-11-07T00:00:54Z","git_url":"git://github.com/rmotr/rmotr-sis.git","ssh_url":"git@github.com:rmotr/rmotr-sis.git","clone_url":"https://github.com/rmotr/rmotr-sis.git","svn_url":"https://github.com/rmotr/rmotr-sis","homepage":null,"size":1276,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":11,"forks":2,"open_issues":11,"watchers":0,"default_branch":"master"}},"base":{"label":"rmotr:master","ref":"master","sha":"24799844a47e088e8ebb634c6008053501ecf764","user":{"login":"rmotr","id":10223902,"avatar_url":"https://avatars.githubusercontent.com/u/10223902?v=3","gravatar_id":"","url":"https://api.github.com/users/rmotr","html_url":"https://github.com/rmotr","followers_url":"https://api.github.com/users/rmotr/followers","following_url":"https://api.github.com/users/rmotr/following{/other_user}","gists_url":"https://api.github.com/users/rmotr/gists{/gist_id}","starred_url":"https://api.github.com/users/rmotr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmotr/subscriptions","organizations_url":"https://api.github.com/users/rmotr/orgs","repos_url":"https://api.github.com/users/rmotr/repos","events_url":"https://api.github.com/users/rmotr/events{/privacy}","received_events_url":"https://api.github.com/users/rmotr/received_events","type":"Organization","site_admin":false},"repo":{"id":31744825,"name":"rmotr-sis","full_name":"rmotr/rmotr-sis","owner":{"login":"rmotr","id":10223902,"avatar_url":"https://avatars.githubusercontent.com/u/10223902?v=3","gravatar_id":"","url":"https://api.github.com/users/rmotr","html_url":"https://github.com/rmotr","followers_url":"https://api.github.com/users/rmotr/followers","following_url":"https://api.github.com/users/rmotr/following{/other_user}","gists_url":"https://api.github.com/users/rmotr/gists{/gist_id}","starred_url":"https://api.github.com/users/rmotr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmotr/subscriptions","organizations_url":"https://api.github.com/users/rmotr/orgs","repos_url":"https://api.github.com/users/rmotr/repos","events_url":"https://api.github.com/users/rmotr/events{/privacy}","received_events_url":"https://api.github.com/users/rmotr/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rmotr/rmotr-sis","description":"Student information system for rmotr.com organization.","fork":false,"url":"https://api.github.com/repos/rmotr/rmotr-sis","forks_url":"https://api.github.com/repos/rmotr/rmotr-sis/forks","keys_url":"https://api.github.com/repos/rmotr/rmotr-sis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rmotr/rmotr-sis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rmotr/rmotr-sis/teams","hooks_url":"https://api.github.com/repos/rmotr/rmotr-sis/hooks","issue_events_url":"https://api.github.com/repos/rmotr/rmotr-sis/issues/events{/number}","events_url":"https://api.github.com/repos/rmotr/rmotr-sis/events","assignees_url":"https://api.github.com/repos/rmotr/rmotr-sis/assignees{/user}","branches_url":"https://api.github.com/repos/rmotr/rmotr-sis/branches{/branch}","tags_url":"https://api.github.com/repos/rmotr/rmotr-sis/tags","blobs_url":"https://api.github.com/repos/rmotr/rmotr-sis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rmotr/rmotr-sis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rmotr/rmotr-sis/git/refs{/sha}","trees_url":"https://api.github.com/repos/rmotr/rmotr-sis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rmotr/rmotr-sis/statuses/{sha}","languages_url":"https://api.github.com/repos/rmotr/rmotr-sis/languages","stargazers_url":"https://api.github.com/repos/rmotr/rmotr-sis/stargazers","contributors_url":"https://api.github.com/repos/rmotr/rmotr-sis/contributors","subscribers_url":"https://api.github.com/repos/rmotr/rmotr-sis/subscribers","subscription_url":"https://api.github.com/repos/rmotr/rmotr-sis/subscription","commits_url":"https://api.github.com/repos/rmotr/rmotr-sis/commits{/sha}","git_commits_url":"https://api.github.com/repos/rmotr/rmotr-sis/git/commits{/sha}","comments_url":"https://api.github.com/repos/rmotr/rmotr-sis/comments{/number}","issue_comment_url":"https://api.github.com/repos/rmotr/rmotr-sis/issues/comments{/number}","contents_url":"https://api.github.com/repos/rmotr/rmotr-sis/contents/{+path}","compare_url":"https://api.github.com/repos/rmotr/rmotr-sis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rmotr/rmotr-sis/merges","archive_url":"https://api.github.com/repos/rmotr/rmotr-sis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rmotr/rmotr-sis/downloads","issues_url":"https://api.github.com/repos/rmotr/rmotr-sis/issues{/number}","pulls_url":"https://api.github.com/repos/rmotr/rmotr-sis/pulls{/number}","milestones_url":"https://api.github.com/repos/rmotr/rmotr-sis/milestones{/number}","notifications_url":"https://api.github.com/repos/rmotr/rmotr-sis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rmotr/rmotr-sis/labels{/name}","releases_url":"https://api.github.com/repos/rmotr/rmotr-sis/releases{/id}","created_at":"2015-03-06T00:43:08Z","updated_at":"2015-09-30T17:56:58Z","pushed_at":"2015-11-07T00:00:54Z","git_url":"git://github.com/rmotr/rmotr-sis.git","ssh_url":"git@github.com:rmotr/rmotr-sis.git","clone_url":"https://github.com/rmotr/rmotr-sis.git","svn_url":"https://github.com/rmotr/rmotr-sis","homepage":null,"size":1276,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":11,"forks":2,"open_issues":11,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rmotr/rmotr-sis/pulls/65"},"html":{"href":"https://github.com/rmotr/rmotr-sis/pull/65"},"issue":{"href":"https://api.github.com/repos/rmotr/rmotr-sis/issues/65"},"comments":{"href":"https://api.github.com/repos/rmotr/rmotr-sis/issues/65/comments"},"review_comments":{"href":"https://api.github.com/repos/rmotr/rmotr-sis/pulls/65/comments"},"review_comment":{"href":"https://api.github.com/repos/rmotr/rmotr-sis/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rmotr/rmotr-sis/pulls/65/commits"},"statuses":{"href":"https://api.github.com/repos/rmotr/rmotr-sis/statuses/f5ed869412c8ebbbb545f94b738a610ff36b4b98"}}}}