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

🧹 Replace 403 by 401 in some occurences #5394

Merged
merged 14 commits into from
Apr 17, 2024
Merged

🧹 Replace 403 by 401 in some occurences #5394

merged 14 commits into from
Apr 17, 2024

Conversation

Annelein
Copy link
Collaborator

Fixes #3634

How to test
Not really possible I think, but all unit tests should pass of course.

@Annelein
Copy link
Collaborator Author

Annelein commented Apr 10, 2024

@Felienne

  • I wasn't sure about some 403's, so I commented on them, can you let me know if these should be 401's?
  • some errors that I changed to 401's, have different error messages then, "unauthorized", for example all occurrences in statistics.py. Should these error messages be changed to "unauthorized"?
  • I will of course fix the unittests after I know for sure that these are the correct error responses!

@Felienne
Copy link
Member

@Felienne

  • I wasn't sure about some 403's, so I commented on them, can you let me know if these should be 401's?
  • some errors that I changed to 401's, have different error messages then, "unauthorized", for example all occurrences in statistics.py. Should these error messages be changed to "unauthorized"?
  • I will of course fix the unittests after I know for sure that these are the correct error responses!

Pinging @TiBiBa (or otherwise maybe @rix0rrr or @jpelay here) I did not make this issue and I am not really an expert in this actually :)

Copy link
Member

@jpelay jpelay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Annelein I commented on each case that I saw a comment of yours, hope it helped!

website/auth_pages.py Show resolved Hide resolved
website/for_teachers.py Outdated Show resolved Hide resolved
website/for_teachers.py Outdated Show resolved Hide resolved
website/statistics.py Outdated Show resolved Hide resolved
@jpelay
Copy link
Member

jpelay commented Apr 16, 2024

some errors that I changed to 401's, have different error messages then, "unauthorized", for example all occurrences in statistics.py. Should these error messages be changed to "unauthorized"?

I think that it's fine to have some more descriptive error messages than just a generic one.

@Annelein Annelein requested a review from jpelay April 17, 2024 14:58
@Annelein Annelein marked this pull request as ready for review April 17, 2024 14:58
Copy link
Member

@jpelay jpelay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job!

Copy link
Contributor

mergify bot commented Apr 17, 2024

Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 2a98ec9 into main Apr 17, 2024
12 checks passed
@mergify mergify bot deleted the replace-403-by-401 branch April 17, 2024 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[CLEAN-UP] Replace 403 error (forbidden) by 401 (unauthorized)
3 participants