Skip to content
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

Merged
merged 6 commits into from
Aug 6, 2024

Conversation

faucomte97
Copy link
Contributor

@faucomte97 faucomte97 commented Jul 30, 2024

This change is Reviewable

@faucomte97 faucomte97 self-assigned this Jul 30, 2024
Copy link
Collaborator

@SKairinos SKairinos left a 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

Copy link
Collaborator

@SKairinos SKairinos left a 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

Copy link
Contributor Author

@faucomte97 faucomte97 left a 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.

Copy link
Collaborator

@SKairinos SKairinos left a 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

Copy link
Collaborator

@SKairinos SKairinos left a 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 and independent_student_queryset entirely and directly returnuser_queryset

*delete ... entirely

Copy link
Contributor Author

@faucomte97 faucomte97 left a 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.

Copy link
Collaborator

@SKairinos SKairinos left a 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: :shipit: complete! all files reviewed, all discussions resolved (waiting on @faucomte97)

@faucomte97 faucomte97 merged commit 97344d5 into master Aug 6, 2024
6 of 7 checks passed
@faucomte97 faucomte97 deleted the anonymisation_warnings branch August 6, 2024 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants