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

Anonymize user #307

Merged
merged 14 commits into from
Feb 22, 2024
Merged

Anonymize user #307

merged 14 commits into from
Feb 22, 2024

Conversation

SKairinos
Copy link
Contributor

@SKairinos SKairinos commented Feb 21, 2024

This change is Reviewable

Copy link
Contributor

@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.

Reviewed 13 of 13 files at r1, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @SKairinos)


backend/Pipfile line 10 at r1 (raw file):

#   https://github.com/ocadotechnology/codeforlife-package-python/blob/{ref}/Pipfile
# Replace "{ref}" in the above URL with the ref set below.
codeforlife = {ref = "anonymize_user", git = "https://github.com/ocadotechnology/codeforlife-package-python.git"}

Update


backend/api/tests/views/test_user.py line 486 at r1 (raw file):

    def test_destroy__independent(self):
        """Independent-users can anonymize themself."""

Should we add a check here that this also anonymises the student linked to that independent user? Even if, in the future, indies won't have a Student object linked to them anymore.


backend/api/views/user.py line 83 at r1 (raw file):

                elif (
                    user.teacher.is_admin
                    and not other_school_teachers.filter(is_admin=True).exists()

the School model has a prop called admins (returns a list of admin Teachers, or None if there aren't any) which you could use here, you could do something like and not user.teacher.school.admins if you prefer it. I don't really mind either way

@SKairinos
Copy link
Contributor Author

backend/api/tests/views/test_user.py line 486 at r1 (raw file):

Previously, faucomte97 (Florian Aucomte) wrote…

Should we add a check here that this also anonymises the student linked to that independent user? Even if, in the future, indies won't have a Student object linked to them anymore.

why would we want to anonymize the student linked to the independent? there's no sensitive data fields

Copy link
Contributor Author

@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, 3 unresolved discussions (waiting on @faucomte97)


backend/Pipfile line 10 at r1 (raw file):

Previously, faucomte97 (Florian Aucomte) wrote…

Update

Done.


backend/api/views/user.py line 83 at r1 (raw file):

Previously, faucomte97 (Florian Aucomte) wrote…

the School model has a prop called admins (returns a list of admin Teachers, or None if there aren't any) which you could use here, you could do something like and not user.teacher.school.admins if you prefer it. I don't really mind either way

I see! That's a good idea but for now I prefer to keep it this was as that admins prop is less efficient. It fetches all the teacher objects from the db but all I want is the exists bool.

Copy link
Contributor

@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.

:lgtm:

Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @SKairinos)

@SKairinos SKairinos merged commit cc76c1a into development Feb 22, 2024
3 of 6 checks passed
@SKairinos SKairinos deleted the anonymize_user branch February 22, 2024 10: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