Skip to content
This repository has been archived by the owner on Oct 28, 2020. It is now read-only.

Commit

Permalink
Merge pull request #765 from johngian/1011744
Browse files Browse the repository at this point in the history
 Disable report reminders for new Reps and their mentors
  • Loading branch information
johngian committed Jun 5, 2014
2 parents 0f76ecf + ecb3802 commit 7bd8417
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions remo/reports/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ def send_first_report_notification():
userprofile__first_report_notification__isnull=True)
# Exclude users with a report filed between start and end period
# and users who joined the program less than one month
inactive_users = users.exclude(
ng_reports__report_date__range=[start, end],
userprofile__date_joined_program__gt=start)
inactive_users = (users
.exclude(ng_reports__report_date__range=[start, end])
.exclude(userprofile__date_joined_program__gt=start))

send_report_notification(inactive_users, weeks=4)
for user in inactive_users:
Expand All @@ -91,9 +91,9 @@ def send_second_report_notification():
userprofile__second_report_notification__isnull=True)
# Exclude users with a report filed between start and end period
# and users who joined the program less than one month
inactive_users = users.exclude(
ng_reports__report_date__range=[start, end],
userprofile__date_joined_program__gt=start)
inactive_users = (users
.exclude(ng_reports__report_date__range=[start, end])
.exclude(userprofile__date_joined_program__gt=start))

send_report_notification(inactive_users, weeks=8)
for user in inactive_users:
Expand Down
3 changes: 2 additions & 1 deletion remo/reports/tests/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ def test_base(self):
mentor = UserFactory.create(groups=['Mentor'])
today = now().date()
rep = UserFactory.create(
groups=['Rep'], userprofile__mentor=mentor)
groups=['Rep'], userprofile__mentor=mentor,
userprofile__date_joined_program=get_date(days=-100))
NGReportFactory.create(user=rep,
report_date=today - timedelta(weeks=5))

Expand Down

0 comments on commit 7bd8417

Please sign in to comment.