-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Create cron job endpoints for incoming anonymisation warnings #2333
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 4 files at r1, all commit messages.
Reviewable status: 3 of 4 files reviewed, 2 unresolved discussions (waiting on @faucomte97)
portal/views/cron/user.py
line 54 at r1 (raw file):
def get_inactive_users(
since same_day is always true, remove the arg and the if check.
portal/views/cron/user.py
line 93 at r1 (raw file):
) return teacher_queryset, independent_student_queryset
since you just get the union of these 2 sets after calling them, just return user_queryset directly
return user_queryset
Code quote:
teacher_queryset = user_queryset.filter(
new_teacher__isnull=False,
new_student__isnull=True,
)
independent_student_queryset = user_queryset.filter(
new_teacher__isnull=True,
new_student__class_field__isnull=True,
)
return teacher_queryset, independent_student_queryset
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 3 of 4 files reviewed, 7 unresolved discussions (waiting on @faucomte97)
portal/tests/test_views.py
line 1247 at r1 (raw file):
if assert_called: mock_send_dotdigital_email.assert_any_call( ANY, [self.teacher_user.email]
instead of ANY, check the specific email template id was used as an arg in the call
portal/tests/test_views.py
line 1251 at r1 (raw file):
mock_send_dotdigital_email.assert_any_call( ANY, [self.indy_user.email]
instead of ANY, check the specific email template id was used as an arg in the call
portal/tests/test_views.py
line 1265 at r1 (raw file):
self.send_inactivity_reminder(730, "first-inactivity-reminder", True) self.send_inactivity_reminder(731, "first-inactivity-reminder", False) self.send_inactivity_reminder(732, "first-inactivity-reminder", False)
no need to check 2 days after. only the day before and the day after
portal/tests/test_views.py
line 1271 at r1 (raw file):
self.send_inactivity_reminder(973, "second-inactivity-reminder", True) self.send_inactivity_reminder(974, "second-inactivity-reminder", False) self.send_inactivity_reminder(975, "second-inactivity-reminder", False)
no need to check 2 days after. only the day before and the day after
portal/tests/test_views.py
line 1277 at r1 (raw file):
self.send_inactivity_reminder(1065, "third-inactivity-reminder", True) self.send_inactivity_reminder(1066, "third-inactivity-reminder", False) self.send_inactivity_reminder(1067, "third-inactivity-reminder", False)
no need to check 2 days after. only the day before and the day after
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 3 of 4 files reviewed, 7 unresolved discussions (waiting on @faucomte97 and @SKairinos)
portal/tests/test_views.py
line 1247 at r1 (raw file):
Previously, SKairinos (Stefan Kairinos) wrote…
instead of ANY, check the specific email template id was used as an arg in the call
Done.
portal/tests/test_views.py
line 1251 at r1 (raw file):
Previously, SKairinos (Stefan Kairinos) wrote…
instead of ANY, check the specific email template id was used as an arg in the call
Done.
portal/tests/test_views.py
line 1265 at r1 (raw file):
Previously, SKairinos (Stefan Kairinos) wrote…
no need to check 2 days after. only the day before and the day after
Done.
portal/tests/test_views.py
line 1271 at r1 (raw file):
Previously, SKairinos (Stefan Kairinos) wrote…
no need to check 2 days after. only the day before and the day after
Done.
portal/tests/test_views.py
line 1277 at r1 (raw file):
Previously, SKairinos (Stefan Kairinos) wrote…
no need to check 2 days after. only the day before and the day after
Done.
portal/views/cron/user.py
line 54 at r1 (raw file):
Previously, SKairinos (Stefan Kairinos) wrote…
since same_day is always true, remove the arg and the if check.
Done.
portal/views/cron/user.py
line 93 at r1 (raw file):
Previously, SKairinos (Stefan Kairinos) wrote…
since you just get the union of these 2 sets after calling them, just return user_queryset directly
return user_queryset
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 3 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @faucomte97)
portal/views/cron/user.py
line 93 at r1 (raw file):
Previously, faucomte97 (Florian Aucomte) wrote…
Done.
not exactly. just teacher_queryset
and independent_student_queryset
entirely and directly returnuser_queryset
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @faucomte97)
portal/views/cron/user.py
line 93 at r1 (raw file):
Previously, SKairinos (Stefan Kairinos) wrote…
not exactly. just
teacher_queryset
andindependent_student_queryset
entirely and directly returnuser_queryset
*delete ... entirely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 3 of 4 files reviewed, 1 unresolved discussion (waiting on @SKairinos)
portal/views/cron/user.py
line 93 at r1 (raw file):
Previously, SKairinos (Stefan Kairinos) wrote…
*delete ... entirely
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 3 files at r3, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @faucomte97)
This change is