Skip to content

improve http status codes#161

Merged
dantownsend merged 1 commit intomasterfrom
http-status-codes
Jul 4, 2022
Merged

improve http status codes#161
dantownsend merged 1 commit intomasterfrom
http-status-codes

Conversation

@dantownsend
Copy link
Member

@dantownsend dantownsend commented Jul 3, 2022

Some of the HTTP status codes were incorrect - the endpoints were returning 401, which means permission denied, when 422 is more appropriate, as they are validation errors.

This is important for Piccolo Admin, as we configure axios to intercept any 401 errors, and redirect to the login page.

@dantownsend dantownsend added the enhancement New feature or request label Jul 3, 2022
@dantownsend
Copy link
Member Author

@sinisaos We need this change, because that's why in this PR it was redirecting to the login page if there was an error in the change password form:

piccolo-orm/piccolo_admin#168

@codecov-commenter
Copy link

codecov-commenter commented Jul 3, 2022

Codecov Report

Merging #161 (8e193ba) into master (96a8a26) will not change coverage.
The diff coverage is 75.00%.

@@           Coverage Diff           @@
##           master     #161   +/-   ##
=======================================
  Coverage   88.38%   88.38%           
=======================================
  Files          29       29           
  Lines        1576     1576           
=======================================
  Hits         1393     1393           
  Misses        183      183           
Impacted Files Coverage Δ
piccolo_api/register/endpoints.py 80.43% <ø> (ø)
piccolo_api/session_auth/endpoints.py 75.15% <0.00%> (ø)
piccolo_api/change_password/endpoints.py 85.71% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 96a8a26...8e193ba. Read the comment docs.

@sinisaos
Copy link
Member

sinisaos commented Jul 4, 2022

@dantownsend This is great and should work.

@dantownsend
Copy link
Member Author

@sinisaos Cool - I'll release this, then will release the change password feature in Piccolo Admin.

@dantownsend dantownsend merged commit ef04f8c into master Jul 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants