Skip to content

Commit e47d999

Browse files
Merge pull request #26 from pepsimidamerica/dev_clamb
Added Method to HTTP error logging.
2 parents f4f48bf + 799126e commit e47d999

File tree

4 files changed

+18
-14
lines changed

4 files changed

+18
-14
lines changed

ezoff/_helpers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def _log_request(
7373

7474
logger.error('*' * 50)
7575
logger.error(msg)
76+
logger.error(f'HTTP Method: {call_method.__name__}')
7677
logger.error(f"URL: {url}")
7778
logger.error(f"Headers: {headers}")
7879

ezoff/work_orders.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from typing import Literal
1313

1414
from ezoff._auth import Decorators
15-
from ezoff._helpers import http_post, http_get, http_patch, http_delete
15+
from ezoff._helpers import http_post, http_get, http_patch, http_delete, http_put
1616
from ezoff.data_model import (
1717
Component,
1818
LinkedInventory,
@@ -461,7 +461,7 @@ def work_order_update(work_order_id: int, update_data: dict) -> WorkOrder | None
461461
raise ValueError(f"'{field}' is not a valid field for a group.")
462462

463463
url = f"https://{os.environ['EZO_SUBDOMAIN']}.ezofficeinventory.com/api/v2/work_orders/{work_order_id}"
464-
response = http_post(
464+
response = http_put(
465465
url=url, payload={"work_order": update_data}, title="Work Order Update"
466466
)
467467

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "ezoff"
3-
version = "1.24.7"
3+
version = "1.24.8"
44
description = "Python package for interacting with EZOffice API"
55
readme = "README.md"
66
authors = [{ name = "Jordan Maynor", email = "[email protected]" }]

unit_tests.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,11 @@ def check_work_order_force_complete():
7272

7373

7474
def check_work_order_update():
75-
work_order_id = 35220
76-
update_data = {"custom_fields": [{"id": 739, "value": "11 Marion"}]}
75+
# work_order_id = 35220
76+
# update_data = {"custom_fields": [{"id": 739, "value": "11 Marion"}]}
77+
78+
work_order_id = 36736
79+
update_data = {'location_id': 160, 'custom_fields': [{'id': 739, 'value': '11 Marion'}]}
7780

7881
work_order_update(work_order_id=work_order_id, update_data=update_data)
7982

@@ -88,19 +91,19 @@ def check_work_order_routing_update():
8891
reviewer_id=244379,
8992
)
9093

91-
check_work_order_return()
92-
check_work_orders_return()
93-
check_checklist_return()
94+
# check_work_order_return()
95+
# check_work_orders_return()
96+
# check_checklist_return()
9497

95-
check_members_return()
96-
check_members_return_v1()
98+
# check_members_return()
99+
# check_members_return_v1()
97100

98-
check_assets_return()
101+
# check_assets_return()
99102

100-
check_locations_return()
101-
check_location_return()
103+
# check_locations_return()
104+
# check_location_return()
102105

103106
# check_work_order_force_complete()
104-
# check_work_order_update()
107+
check_work_order_update()
105108

106109
# check_work_order_routing_update()

0 commit comments

Comments
 (0)