Skip to content

Conversation

@sourcery-ai
Copy link

@sourcery-ai sourcery-ai bot commented Jul 29, 2023

Branch main refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the main branch, then run:

git fetch origin sourcery/main
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from ibeswipin July 29, 2023 15:43
uuid = res[0]['uuid']

return uuid
return res[0]['uuid']
Copy link
Author

Choose a reason for hiding this comment

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

Function Client.get_organization_id refactored with the following changes:

Comment on lines -81 to +79
attachment_response = self.upload_attachment(attachment)
if attachment_response:
if attachment_response := self.upload_attachment(attachment):
Copy link
Author

Choose a reason for hiding this comment

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

Function Client.send_message refactored with the following changes:

This removes the following comments ( why? ):

# Returns answer

Comment on lines -153 to +147
if response.status_code == 204:
return True
else:
return False
return response.status_code == 204
Copy link
Author

Choose a reason for hiding this comment

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

Function Client.delete_conversation refactored with the following changes:

Comment on lines -184 to +175
formatted_uuid = f"{random_uuid_str[0:8]}-{random_uuid_str[9:13]}-{random_uuid_str[14:18]}-{random_uuid_str[19:23]}-{random_uuid_str[24:]}"
return formatted_uuid
return f"{random_uuid_str[:8]}-{random_uuid_str[9:13]}-{random_uuid_str[14:18]}-{random_uuid_str[19:23]}-{random_uuid_str[24:]}"
Copy link
Author

Choose a reason for hiding this comment

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

Function Client.generate_uuid refactored with the following changes:

Comment on lines -248 to +238
if response.status_code == 200:
return response.json()
else:
return False
return response.json() if response.status_code == 200 else False
Copy link
Author

Choose a reason for hiding this comment

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

Function Client.upload_attachment refactored with the following changes:

Comment on lines -281 to +268
if response.status_code == 200:
return True
else:
return False
return response.status_code == 200
Copy link
Author

Choose a reason for hiding this comment

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

Function Client.rename_chat refactored with the following changes:

Comment on lines -5 to -8
cookie = os.environ.get('cookie')
if not cookie:
if cookie := os.environ.get('cookie'):
return cookie
else:
raise ValueError("Please set the 'cookie' environment variable.")
return cookie
Copy link
Author

Choose a reason for hiding this comment

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

Function get_cookie refactored with the following changes:

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.

1 participant