-
-
Notifications
You must be signed in to change notification settings - Fork 299
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
TagActions.remove must return a single data type #135
Comments
After investigating the issue it turned out that
Here
The author of the code has left a comment, that a possible error could occur here if Possible solution would be the return time of the |
This is correct (mostly). The if condition will evaluate to True if the first letter of the error message is empty string or we return a tuple with first element False, which is not the case in practice. A quick fix would be to However the entire view function doesn't look right. All of the @asankov if you want to continue working on this I suggest first adding some tests and then applying the quick fix before we can discuss anything further. |
This method either returns a string or a tuple of (bool, object) which makes me wonder is the return value even used ! This obviously needs to be examined and rectified.
Update: while at it the method uses a
.filter()[0]
expression with anexcept IndexError
to figure out if an object exists. Obviously this can be written more organically as.get() except ObjectDoesNotExist
.The text was updated successfully, but these errors were encountered: