Skip to content

Commit

Permalink
Fix bug in cancel_order due to wrong concatenation syntax (#296)
Browse files Browse the repository at this point in the history
* Fix bug in cancel_order due to wrong concatenation syntax
* Add news fragment
  • Loading branch information
Te12944265-AMAHA authored Nov 26, 2022
1 parent 0448221 commit 087580e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions newsfragments/296.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bug in cancel_order due to wrong concatenation syntax.
4 changes: 2 additions & 2 deletions pyrh/robinhood.py
Original file line number Diff line number Diff line change
Expand Up @@ -1444,7 +1444,7 @@ def cancel_order(self, order_id): # noqa: C901
"""
if isinstance(order_id, str):
try:
order = self.get(urls.build_orders() + order_id)
order = self.get(urls.build_orders(order_id))
except (requests.exceptions.HTTPError) as err_msg:
raise ValueError(
"Failed to get Order for ID: "
Expand Down Expand Up @@ -1475,7 +1475,7 @@ def cancel_order(self, order_id): # noqa: C901
elif isinstance(order_id, dict):
order_id = order_id["id"]
try:
order = self.get(urls.build_orders() + order_id)
order = self.get(urls.build_orders(order_id))
except (requests.exceptions.HTTPError) as err_msg:
raise ValueError(
"Failed to get Order for ID: "
Expand Down
2 changes: 1 addition & 1 deletion pyrh/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def build_orders(order_id: Optional[str] = None) -> URL:
"""
if order_id is not None:
return ORDERS_BASE / f"/{order_id}/"
return ORDERS_BASE / f"{order_id}/"
else:
return ORDERS_BASE

Expand Down

0 comments on commit 087580e

Please sign in to comment.