{"action":"created","issue":{"url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/issues/1549","repository_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal","labels_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/issues/1549/labels{/name}","comments_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/issues/1549/comments","events_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/issues/1549/events","html_url":"https://github.com/uwcirg/true_nth_usa_portal/pull/1549","id":268225160,"number":1549,"title":"TN-136 Weekly site summary email","user":{"login":"OptimusRhine","id":838805,"avatar_url":"https://avatars0.githubusercontent.com/u/838805?v=4","gravatar_id":"","url":"https://api.github.com/users/OptimusRhine","html_url":"https://github.com/OptimusRhine","followers_url":"https://api.github.com/users/OptimusRhine/followers","following_url":"https://api.github.com/users/OptimusRhine/following{/other_user}","gists_url":"https://api.github.com/users/OptimusRhine/gists{/gist_id}","starred_url":"https://api.github.com/users/OptimusRhine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OptimusRhine/subscriptions","organizations_url":"https://api.github.com/users/OptimusRhine/orgs","repos_url":"https://api.github.com/users/OptimusRhine/repos","events_url":"https://api.github.com/users/OptimusRhine/events{/privacy}","received_events_url":"https://api.github.com/users/OptimusRhine/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-10-25T00:00:51Z","updated_at":"2017-10-25T18:35:06Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/pulls/1549","html_url":"https://github.com/uwcirg/true_nth_usa_portal/pull/1549","diff_url":"https://github.com/uwcirg/true_nth_usa_portal/pull/1549.diff","patch_url":"https://github.com/uwcirg/true_nth_usa_portal/pull/1549.patch"},"body":"https://jira.movember.com/browse/TN-136\r\n\r\n* added `overdue_stats_by_org()` reporting function, which gets a list of (anonymous) overdue questionnaires, stored by days overdue and sorted by org\r\n* added `generate_overdue_table_html()` reporting function, which generates an html table of overdue questionnaire stats\r\n  * separate from `overdue_stats_by_org()`, because (in the email summaries) the table is generated on a per-user basis, but we only ever want to pull the master list of stats once\r\n  * only shows orgs the given user has access to (that user's orgs, and any child orgs of those orgs)\r\n  * if `top_org` is provided, also only shows orgs that are within the `top_org`'s org tree\r\n  * takes a `cutoff_days` param, which dictates the split of columns\r\n    * e.g. `cutoff_days=[7,14,21]` will result in columns of '1-7 Days', '8-14 Days', & '15-21 Days' (with the data split correctly between them)\r\n  * includes per-org total column, and overall totals row\r\n* added new celery task, to generate a site summary email\r\n  * takes `top_org` and `cutoff_days` params (per the table generation function above)\r\n  * only sends emails to Staff that belong to the given org (or any child orgs)\r\n  * pulls table html from reporting function, pulls other email content from LR\r\n* added table styling to default EmailMessage styling, tightened up restricted tag check\r\n* added SiteSummaryEmail_ATMA AppTextModelAdapter\r\n* added unit tests"},"comment":{"url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/issues/comments/339428110","html_url":"https://github.com/uwcirg/true_nth_usa_portal/pull/1549#issuecomment-339428110","issue_url":"https://api.github.com/repos/uwcirg/true_nth_usa_portal/issues/1549","id":339428110,"user":{"login":"codacy-bot","id":19940114,"avatar_url":"https://avatars1.githubusercontent.com/u/19940114?v=4","gravatar_id":"","url":"https://api.github.com/users/codacy-bot","html_url":"https://github.com/codacy-bot","followers_url":"https://api.github.com/users/codacy-bot/followers","following_url":"https://api.github.com/users/codacy-bot/following{/other_user}","gists_url":"https://api.github.com/users/codacy-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/codacy-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codacy-bot/subscriptions","organizations_url":"https://api.github.com/users/codacy-bot/orgs","repos_url":"https://api.github.com/users/codacy-bot/repos","events_url":"https://api.github.com/users/codacy-bot/events{/privacy}","received_events_url":"https://api.github.com/users/codacy-bot/received_events","type":"User","site_admin":false},"created_at":"2017-10-25T18:35:06Z","updated_at":"2017-10-25T18:35:06Z","author_association":"NONE","body":"\n![Codacy](https://www.codacy.com/assets/images/favicon.png) Here is an overview of what got changed by this pull request:\n\n\n```diff\n\nComplexity increasing per file\n==============================\n- portal/tasks.py  1\n         \n\nClones added\n============\n- portal/models/reporting.py  2\n         \n```\n\n\nSee the complete overview on [Codacy](https://www.codacy.com/app/ivanc/true_nth_usa_portal/pullRequest?prid=1017409&bid=5635673)\n        "}}
{"actor":{"display_login":"codacy-bot"}}