-
Notifications
You must be signed in to change notification settings - Fork 24
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
Create cron job endpoints for anonymisation warnings #358
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.
Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @faucomte97)
src/api/views/user.py
line 347 at r1 (raw file):
return Response() def _get_inactive_users(self, days: int, same_day: bool):
no need for same_day arg. always True
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: 0 of 3 files reviewed, 2 unresolved discussions (waiting on @faucomte97)
src/api/views/user.py
line 384 at r1 (raw file):
) return teacher_queryset, independent_student_queryset
just return user_queryset directly
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: 0 of 3 files reviewed, 5 unresolved discussions (waiting on @faucomte97)
src/api/views/user.py
line 434 at r1 (raw file):
haven't been active in a while. """ return self._send_verify_email_reminder(
wrong helper
src/api/views/user.py
line 444 at r1 (raw file):
haven't been active in a while. """ return self._send_verify_email_reminder(
wrong helper
src/api/views/user.py
line 455 at r1 (raw file):
haven't been active in a while. """ return self._send_verify_email_reminder(
wrong helper
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 2 of 3 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @faucomte97)
src/api/views/user.py
line 384 at r1 (raw file):
Previously, SKairinos (Stefan Kairinos) wrote…
just return user_queryset directly
not exactly. just delete teacher_queryset
and independent_student_queryset
entirely and directly returnuser_queryset
src/api/views/user_test.py
line 747 at r2 (raw file):
) def _test_send_inactivity_reminder(
you don't call this helper anywhere. need to create tests for each reminder. each test should call this helper
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: 1 of 3 files reviewed, 2 unresolved discussions (waiting on @SKairinos)
src/api/views/user.py
line 347 at r1 (raw file):
Previously, SKairinos (Stefan Kairinos) wrote…
no need for same_day arg. always True
Done.
src/api/views/user.py
line 384 at r1 (raw file):
Previously, SKairinos (Stefan Kairinos) wrote…
just return user_queryset directly
Done.
src/api/views/user.py
line 434 at r1 (raw file):
Previously, SKairinos (Stefan Kairinos) wrote…
wrong helper
Done.
src/api/views/user.py
line 444 at r1 (raw file):
Previously, SKairinos (Stefan Kairinos) wrote…
wrong helper
Done.
src/api/views/user.py
line 455 at r1 (raw file):
Previously, SKairinos (Stefan Kairinos) wrote…
wrong helper
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 2 of 2 files at r3, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @faucomte97)
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.
let's figure out why the tests are failing
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @faucomte97)
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, 2 unresolved discussions (waiting on @faucomte97)
src/api/views/user_test.py
line 761 at r3 (raw file):
assert indy_users for teacher_user in teacher_users:
simplify to TeacherUser.objects.update(date_joined=date_joined)
src/api/views/user_test.py
line 765 at r3 (raw file):
teacher_user.save() for indy_user in indy_users:
simplify to IndependentUser.objects.update(date_joined=date_joined)
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, 2 unresolved discussions (waiting on @faucomte97)
src/api/views/user_test.py
line 761 at r3 (raw file):
Previously, SKairinos (Stefan Kairinos) wrote…
simplify to TeacherUser.objects.update(date_joined=date_joined)
make sure to do this before you get the list of teacher users
src/api/views/user_test.py
line 765 at r3 (raw file):
Previously, SKairinos (Stefan Kairinos) wrote…
simplify to IndependentUser.objects.update(date_joined=date_joined)
make sure to do this before you get the list of indy users
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: 2 of 3 files reviewed, 2 unresolved discussions (waiting on @SKairinos)
src/api/views/user_test.py
line 761 at r3 (raw file):
Previously, SKairinos (Stefan Kairinos) wrote…
make sure to do this before you get the list of teacher users
Done.
src/api/views/user_test.py
line 765 at r3 (raw file):
Previously, SKairinos (Stefan Kairinos) wrote…
make sure to do this before you get the list of indy users
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 1 of 1 files at r4, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @faucomte97)
src/api/views/user_test.py
line 761 at r3 (raw file):
Previously, faucomte97 (Florian Aucomte) wrote…
Done.
you need to do this before you get the list of teacher users
src/api/views/user_test.py
line 765 at r3 (raw file):
Previously, faucomte97 (Florian Aucomte) wrote…
Done.
you need to do this before you get the list of indy users
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, 2 unresolved discussions (waiting on @SKairinos)
src/api/views/user_test.py
line 761 at r3 (raw file):
Previously, SKairinos (Stefan Kairinos) wrote…
you need to do this before you get the list of teacher users
Why? We don't do that in the other helper for the verification reminders 🤔
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, 2 unresolved discussions (waiting on @faucomte97)
src/api/views/user_test.py
line 761 at r3 (raw file):
Previously, faucomte97 (Florian Aucomte) wrote…
Why? We don't do that in the other helper for the verification reminders 🤔
so that you list the latest data. here you've update the data after caching it so the cache is immediately outdated.
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, 2 unresolved discussions (waiting on @faucomte97)
src/api/views/user_test.py
line 761 at r3 (raw file):
Previously, SKairinos (Stefan Kairinos) wrote…
so that you list the latest data. here you've update the data after caching it so the cache is immediately outdated.
not sure why we're not doing it other test. maybe should be done there too
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, 2 unresolved discussions (waiting on @SKairinos)
src/api/views/user_test.py
line 761 at r3 (raw file):
Previously, SKairinos (Stefan Kairinos) wrote…
not sure why we're not doing it other test. maybe should be done there too
Done.
src/api/views/user_test.py
line 765 at r3 (raw file):
Previously, SKairinos (Stefan Kairinos) wrote…
you need to do this before you get the list of indy users
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 1 of 1 files at r5, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @faucomte97)
This change is