Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@djachkov
Copy link
Contributor

@djachkov djachkov commented Sep 8, 2020

Start removing messy api versions

Comment on lines 204 to +207
if not_json_response:
return response.content
if self.advanced_mode:
return response
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please pay attention!
In this place, the order of lines was messed and the 'else' block below ran in wrong cases

Copy link
Member

Choose a reason for hiding this comment

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

Could you reverse that change, please?

Copy link
Contributor

@Spacetown Spacetown left a comment

Choose a reason for hiding this comment

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

This change was also my intension after #584 .


def __init__(self, *args, **kwargs):
super(Bitbucket, self).__init__(*args, **kwargs)
url = kwargs.pop('url', False)
Copy link
Contributor

@Spacetown Spacetown Sep 8, 2020

Choose a reason for hiding this comment

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

This block should be in front of the base init. See #584.

url = 'rest/keys/1.0/projects/{key}/ssh'.format(key=key)
else:
url = 'rest/keys/2.0/projects/{key}/ssh'.format(key=key)
resource = self.resource_url('projects/{key}/ssh'.format(key=key))
Copy link
Contributor

Choose a reason for hiding this comment

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

Here ressource_url MUST not be used, url is .../rest/keys/... and not .../rest/api/...

else:
url = 'rest/keys/2.0/projects/{project_key}/repos/{repo_key}/ssh'.format(project_key=project_key,
repo_key=repo_key)
resource = self.resource_url('projects/{project_key}/repos/{repo_key}/ssh'.format(project_key=project_key,
Copy link
Contributor

Choose a reason for hiding this comment

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

Also .../rest/keys/... and not .../rest/api/...

Copy link
Member

Choose a reason for hiding this comment

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

@Spacetown Any good idea around that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thx, I just missed this part!

Copy link
Contributor

Choose a reason for hiding this comment

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

Create a member function ressource_url_keys which does mealy the same as the ressource_url. I'll create a PR for this.

@djachkov djachkov closed this Sep 9, 2020
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.

3 participants