Skip to content

Conversation

amw
Copy link
Contributor

@amw amw commented Mar 18, 2019

Fixes the pointer for 404 results.

Checklist

  • PR only contains one change (considered splitting up PR)
  • unit-test added
  • documentation updated
  • CHANGELOG.md updated (only for user relevant changes)
  • author name in AUTHORS

@codecov
Copy link

codecov bot commented Mar 18, 2019

Codecov Report

Merging #599 into master will decrease coverage by 0.13%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #599      +/-   ##
==========================================
- Coverage   96.11%   95.98%   -0.14%     
==========================================
  Files          56       56              
  Lines        2859     2866       +7     
==========================================
+ Hits         2748     2751       +3     
- Misses        111      115       +4
Impacted Files Coverage Δ
example/tests/test_model_viewsets.py 100% <100%> (ø) ⬆️
example/tests/integration/test_polymorphism.py 96.74% <0%> (-3.26%) ⬇️

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 b1acaf1...dbe02e4. Read the comment docs.

Copy link
Member

@sliverc sliverc left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution and well spotted, the pointer is invalid indeed.

The specification doesn't specifically clarify what to do in case of a 404 error. In this discussion though they suggest not to add a pointer in case of 404. Sounds kind of logical to me as there is not data actually returned so they can't be a pointer.

Could you adjust your PR so it doesn't add a pointer in case of 404?

@amw amw force-pushed the fix-pointer-for-404 branch from 3f804c9 to 7464deb Compare August 6, 2019 10:42
@amw
Copy link
Contributor Author

amw commented Aug 6, 2019

I've removed the source entirely for 404 errors.

@sliverc sliverc force-pushed the fix-pointer-for-404 branch from 7464deb to b27c84d Compare August 9, 2019 20:46
@sliverc sliverc force-pushed the fix-pointer-for-404 branch from b27c84d to 061ffd5 Compare August 9, 2019 20:50
Copy link
Member

@sliverc sliverc left a comment

Choose a reason for hiding this comment

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

Thanks.

@sliverc sliverc changed the title Fix pointer used by Http404 exception Avoid printing invalid pointer when api returns 404 Aug 9, 2019
@sliverc sliverc merged commit 7efd877 into django-json-api:master Aug 9, 2019
@amw amw deleted the fix-pointer-for-404 branch January 24, 2021 20:38
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