{"action":"created","comment":{"url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/comments/37974365","id":37974365,"diff_hunk":"@@ -0,0 +1,36 @@\n+from celery.schedules import crontab\n+from celery.task import periodic_task\n+from celery.utils.log import get_task_logger\n+import datetime\n+\n+from corehq.apps.data_analytics.malt_generator import MALTTableGenerator\n+from dimagi.utils.dates import DateSpan\n+from dimagi.utils.django.email import send_HTML_email\n+\n+\n+logger = get_task_logger(__name__)\n+\n+\n+@periodic_task(run_every=crontab(hour=1, minute=0, day_of_month='2'))\n+def build_las_month_MALT():\n+    def _last_month_datespan():\n+        today = datetime.date.today()\n+        first_of_this_month = datetime.date(day=1, month=today.month, year=today.year)\n+        last_month = first_of_this_month - datetime.timedelta(days=1)\n+        return DateSpan.from_month(last_month.month, last_month.year)\n+\n+    last_month = _last_month_datespan()\n+    generator = MALTTableGenerator([last_month])\n+    generator.build_table()\n+\n+    data_team_email = 'jwackman@dimagi.com'","path":"corehq/apps/data_analytics/tasks.py","position":26,"original_position":26,"commit_id":"1390ea95c5584358a0bbae44b9ce408e4f0a41a1","original_commit_id":"1390ea95c5584358a0bbae44b9ce408e4f0a41a1","user":{"login":"czue","id":66555,"avatar_url":"https://avatars.githubusercontent.com/u/66555?v=3","gravatar_id":"","url":"https://api.github.com/users/czue","html_url":"https://github.com/czue","followers_url":"https://api.github.com/users/czue/followers","following_url":"https://api.github.com/users/czue/following{/other_user}","gists_url":"https://api.github.com/users/czue/gists{/gist_id}","starred_url":"https://api.github.com/users/czue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/czue/subscriptions","organizations_url":"https://api.github.com/users/czue/orgs","repos_url":"https://api.github.com/users/czue/repos","events_url":"https://api.github.com/users/czue/events{/privacy}","received_events_url":"https://api.github.com/users/czue/received_events","type":"User","site_admin":false},"body":"i was proposing not bothering. if we do leave in an address we should obfuscate it a bit using something like `'@'.join('user', 'dimagi.com')` so that random spambots have a harder time picking it up","created_at":"2015-08-26T12:13:58Z","updated_at":"2015-08-26T12:13:58Z","html_url":"https://github.com/dimagi/commcare-hq/pull/8006#discussion_r37974365","pull_request_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/8006","_links":{"self":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/comments/37974365"},"html":{"href":"https://github.com/dimagi/commcare-hq/pull/8006#discussion_r37974365"},"pull_request":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/8006"}}},"pull_request":{"url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/8006","id":43389623,"html_url":"https://github.com/dimagi/commcare-hq/pull/8006","diff_url":"https://github.com/dimagi/commcare-hq/pull/8006.diff","patch_url":"https://github.com/dimagi/commcare-hq/pull/8006.patch","issue_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/8006","number":8006,"state":"open","locked":false,"title":"automate monthly malt generation","user":{"login":"sravfeyn","id":829142,"avatar_url":"https://avatars.githubusercontent.com/u/829142?v=3","gravatar_id":"","url":"https://api.github.com/users/sravfeyn","html_url":"https://github.com/sravfeyn","followers_url":"https://api.github.com/users/sravfeyn/followers","following_url":"https://api.github.com/users/sravfeyn/following{/other_user}","gists_url":"https://api.github.com/users/sravfeyn/gists{/gist_id}","starred_url":"https://api.github.com/users/sravfeyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sravfeyn/subscriptions","organizations_url":"https://api.github.com/users/sravfeyn/orgs","repos_url":"https://api.github.com/users/sravfeyn/repos","events_url":"https://api.github.com/users/sravfeyn/events{/privacy}","received_events_url":"https://api.github.com/users/sravfeyn/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-26T11:06:17Z","updated_at":"2015-08-26T12:13:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6c60a7239f9c925b8a94a95c851367e6d164e889","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/8006/commits","review_comments_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/8006/comments","review_comment_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/8006/comments","statuses_url":"https://api.github.com/repos/dimagi/commcare-hq/statuses/1390ea95c5584358a0bbae44b9ce408e4f0a41a1","head":{"label":"dimagi:auto-malt","ref":"auto-malt","sha":"1390ea95c5584358a0bbae44b9ce408e4f0a41a1","user":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"repo":{"id":247278,"name":"commcare-hq","full_name":"dimagi/commcare-hq","owner":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dimagi/commcare-hq","description":"A server-side tool to help manage community health workers, written in Django","fork":false,"url":"https://api.github.com/repos/dimagi/commcare-hq","forks_url":"https://api.github.com/repos/dimagi/commcare-hq/forks","keys_url":"https://api.github.com/repos/dimagi/commcare-hq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimagi/commcare-hq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimagi/commcare-hq/teams","hooks_url":"https://api.github.com/repos/dimagi/commcare-hq/hooks","issue_events_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/events{/number}","events_url":"https://api.github.com/repos/dimagi/commcare-hq/events","assignees_url":"https://api.github.com/repos/dimagi/commcare-hq/assignees{/user}","branches_url":"https://api.github.com/repos/dimagi/commcare-hq/branches{/branch}","tags_url":"https://api.github.com/repos/dimagi/commcare-hq/tags","blobs_url":"https://api.github.com/repos/dimagi/commcare-hq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimagi/commcare-hq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimagi/commcare-hq/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimagi/commcare-hq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimagi/commcare-hq/statuses/{sha}","languages_url":"https://api.github.com/repos/dimagi/commcare-hq/languages","stargazers_url":"https://api.github.com/repos/dimagi/commcare-hq/stargazers","contributors_url":"https://api.github.com/repos/dimagi/commcare-hq/contributors","subscribers_url":"https://api.github.com/repos/dimagi/commcare-hq/subscribers","subscription_url":"https://api.github.com/repos/dimagi/commcare-hq/subscription","commits_url":"https://api.github.com/repos/dimagi/commcare-hq/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimagi/commcare-hq/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimagi/commcare-hq/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/comments{/number}","contents_url":"https://api.github.com/repos/dimagi/commcare-hq/contents/{+path}","compare_url":"https://api.github.com/repos/dimagi/commcare-hq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimagi/commcare-hq/merges","archive_url":"https://api.github.com/repos/dimagi/commcare-hq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimagi/commcare-hq/downloads","issues_url":"https://api.github.com/repos/dimagi/commcare-hq/issues{/number}","pulls_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls{/number}","milestones_url":"https://api.github.com/repos/dimagi/commcare-hq/milestones{/number}","notifications_url":"https://api.github.com/repos/dimagi/commcare-hq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimagi/commcare-hq/labels{/name}","releases_url":"https://api.github.com/repos/dimagi/commcare-hq/releases{/id}","created_at":"2009-07-09T17:00:07Z","updated_at":"2015-08-08T13:51:23Z","pushed_at":"2015-08-26T12:12:16Z","git_url":"git://github.com/dimagi/commcare-hq.git","ssh_url":"git@github.com:dimagi/commcare-hq.git","clone_url":"https://github.com/dimagi/commcare-hq.git","svn_url":"https://github.com/dimagi/commcare-hq","homepage":"http://www.commcarehq.org","size":407442,"stargazers_count":49,"watchers_count":49,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":61,"mirror_url":null,"open_issues_count":59,"forks":61,"open_issues":59,"watchers":49,"default_branch":"master"}},"base":{"label":"dimagi:master","ref":"master","sha":"a3c4d7d5046abd94f1663cc5981f28a010c5618b","user":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"repo":{"id":247278,"name":"commcare-hq","full_name":"dimagi/commcare-hq","owner":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dimagi/commcare-hq","description":"A server-side tool to help manage community health workers, written in Django","fork":false,"url":"https://api.github.com/repos/dimagi/commcare-hq","forks_url":"https://api.github.com/repos/dimagi/commcare-hq/forks","keys_url":"https://api.github.com/repos/dimagi/commcare-hq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimagi/commcare-hq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimagi/commcare-hq/teams","hooks_url":"https://api.github.com/repos/dimagi/commcare-hq/hooks","issue_events_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/events{/number}","events_url":"https://api.github.com/repos/dimagi/commcare-hq/events","assignees_url":"https://api.github.com/repos/dimagi/commcare-hq/assignees{/user}","branches_url":"https://api.github.com/repos/dimagi/commcare-hq/branches{/branch}","tags_url":"https://api.github.com/repos/dimagi/commcare-hq/tags","blobs_url":"https://api.github.com/repos/dimagi/commcare-hq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimagi/commcare-hq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimagi/commcare-hq/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimagi/commcare-hq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimagi/commcare-hq/statuses/{sha}","languages_url":"https://api.github.com/repos/dimagi/commcare-hq/languages","stargazers_url":"https://api.github.com/repos/dimagi/commcare-hq/stargazers","contributors_url":"https://api.github.com/repos/dimagi/commcare-hq/contributors","subscribers_url":"https://api.github.com/repos/dimagi/commcare-hq/subscribers","subscription_url":"https://api.github.com/repos/dimagi/commcare-hq/subscription","commits_url":"https://api.github.com/repos/dimagi/commcare-hq/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimagi/commcare-hq/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimagi/commcare-hq/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/comments{/number}","contents_url":"https://api.github.com/repos/dimagi/commcare-hq/contents/{+path}","compare_url":"https://api.github.com/repos/dimagi/commcare-hq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimagi/commcare-hq/merges","archive_url":"https://api.github.com/repos/dimagi/commcare-hq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimagi/commcare-hq/downloads","issues_url":"https://api.github.com/repos/dimagi/commcare-hq/issues{/number}","pulls_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls{/number}","milestones_url":"https://api.github.com/repos/dimagi/commcare-hq/milestones{/number}","notifications_url":"https://api.github.com/repos/dimagi/commcare-hq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimagi/commcare-hq/labels{/name}","releases_url":"https://api.github.com/repos/dimagi/commcare-hq/releases{/id}","created_at":"2009-07-09T17:00:07Z","updated_at":"2015-08-08T13:51:23Z","pushed_at":"2015-08-26T12:12:16Z","git_url":"git://github.com/dimagi/commcare-hq.git","ssh_url":"git@github.com:dimagi/commcare-hq.git","clone_url":"https://github.com/dimagi/commcare-hq.git","svn_url":"https://github.com/dimagi/commcare-hq","homepage":"http://www.commcarehq.org","size":407442,"stargazers_count":49,"watchers_count":49,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":61,"mirror_url":null,"open_issues_count":59,"forks":61,"open_issues":59,"watchers":49,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/8006"},"html":{"href":"https://github.com/dimagi/commcare-hq/pull/8006"},"issue":{"href":"https://api.github.com/repos/dimagi/commcare-hq/issues/8006"},"comments":{"href":"https://api.github.com/repos/dimagi/commcare-hq/issues/8006/comments"},"review_comments":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/8006/comments"},"review_comment":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/8006/commits"},"statuses":{"href":"https://api.github.com/repos/dimagi/commcare-hq/statuses/1390ea95c5584358a0bbae44b9ce408e4f0a41a1"}}}}