We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
If I do:
api.content.delete(objects=[])
I expect that the function will do nothing and exit without errors. However, an exception is raised.
The reason is the first line of code of the delete function:
delete
objects = objects or [obj]
Since objects is an empty list and obj is None (the default value) we end up with objects being [None].
objects
obj
None
[None]
An easy way to fix is to filter out None objects from the resulting list:
objects = objects or [obj] objects = [o for o in objects if o is not None] if not objects: return
The text was updated successfully, but these errors were encountered:
That could be handled on the decorators to keep the function simple and easy to read as well.
Sorry, something went wrong.
No branches or pull requests
If I do:
I expect that the function will do nothing and exit without errors. However, an exception is raised.
The reason is the first line of code of the
delete
function:Since
objects
is an empty list andobj
isNone
(the default value) we end up withobjects
being[None]
.An easy way to fix is to filter out
None
objects from the resulting list:The text was updated successfully, but these errors were encountered: