-
Notifications
You must be signed in to change notification settings - Fork 308
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
Fix error that prevents posting to api/contents
endpoint with no body
#937
Conversation
Thanks for submitting your first pull request! You are awesome! 🤗 |
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.
LGTM - confirmed the test reproduces the issue prior to this change and the changes fix the issue. Thanks @kiersten-stokes!
Codecov Report
@@ Coverage Diff @@
## main #937 +/- ##
==========================================
- Coverage 72.28% 72.20% -0.08%
==========================================
Files 65 65
Lines 8002 8001 -1
Branches 1336 1333 -3
==========================================
- Hits 5784 5777 -7
- Misses 1811 1814 +3
- Partials 407 410 +3
Continue to review full report at Codecov.
|
@meeseeksdev please backport to 1.x |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
await self._copy(copy_from, path) | ||
else: | ||
await self._new_untitled(path, type=type, ext=ext) | ||
await self._new_untitled(path, type=type, ext=ext) |
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.
Shouldn't this path only trigger if copy_from
is false?
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.
Shoot, yeah good catch - looks like a follow-up is in order!
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.
Thanks @vidartf - I apologize for not catching this as well.
Fixes #931
This is a small refactor to avoid a 'NoneType'
AttributeError
when sending a POST request toapi/contents
that does not include a body.A body-less POST to the
api/contents/{path}
endpoint is also added toservices/contents/test_api.py:test_create_untitled
.