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

Fixed a TypeError with join in __init__ for 422 responses #55

Closed
wants to merge 1 commit into
base: master
from

Conversation

3 participants
@signalkraft

signalkraft commented Oct 9, 2014

On your latest revision with Chiliproject 3.8.0 I got the following exception when creating an issue with a parent outside of the selected project:

File "redmine/__init__.py", line 132, in request
    raise ValidationError(to_string(', '.join(json_response(response.json)['errors'])))
TypeError: sequence item 0: expected string, list found

I fixed this problem for my case by joining twice if not all errors are strings.

Now it raises a ValidationError with the following message:

parent_issue_id: doesn't belong to the same project
Philipp Dörner
@coveralls

This comment has been minimized.

coveralls commented Oct 9, 2014

Coverage Status

Changes Unknown when pulling 0bd2ce0 on signalkraft:response-422-fix into * on maxtepkeev:master*.

@maxtepkeev maxtepkeev added the bug label Oct 9, 2014

@maxtepkeev maxtepkeev self-assigned this Oct 9, 2014

maxtepkeev added a commit that referenced this pull request Oct 9, 2014

@maxtepkeev

This comment has been minimized.

Owner

maxtepkeev commented Oct 9, 2014

Hi!

Thanks for the pull request but unfortunately I can't merge it because:

  1. It won't work in Python 3, because there is no basestring there anymore
  2. It won't work if there were 2 or more errors returned and some of them are strings and other are lists, e.g.
errors = ['foo', 'bar', ['foo', 'bar'], 'baz', ['bar', 'baz']]

Anyway thank you for reporting this, I've implemented the fix in 72399ac, it will be a part of the next release.

@maxtepkeev maxtepkeev closed this Oct 9, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment