-
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
Anonymize user #307
Anonymize user #307
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 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
Previously, faucomte97 (Florian Aucomte) wrote…
why would we want to anonymize the student linked to the independent? there's no sensitive data fields |
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, 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 likeand 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.
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 r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @SKairinos)
This change is