Skip to content
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

update config.py and main.py #386

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion findmyorder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,4 +208,6 @@ async def get_order(

"""
for client in self.clients:
return await client.get_order(message)
order = await client.get_order(message)
Copy link

Choose a reason for hiding this comment

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

issue (bug_risk): Potential issue with returning the first non-null order

The current implementation returns the first non-null order found. If there are multiple clients and the order from the first client is incomplete or incorrect, this could lead to issues. Consider whether additional validation or checks are needed before returning the order.

if order:
Copy link

Choose a reason for hiding this comment

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

suggestion: Clarify the condition for 'if order'

The condition 'if order' checks for a truthy value. Ensure that this condition is sufficient for your use case. If 'order' can be an empty object or have other falsy values that should still be considered valid, you might need a more specific check.

Suggested change
if order:
if order is not None and order != {}:

return order