Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DESENG-515: Fixing code cov comments
Browse files Browse the repository at this point in the history
ratheesh-aot committed Mar 15, 2024
1 parent 58469bc commit 1045b42
Showing 3 changed files with 4 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -31,11 +31,6 @@ def get_engagement_id(event_id):
error='Event not found',
)
widget = WidgetService.get_widget_by_id(widget_event.widget_id)
if not widget:
raise BusinessException(
status_code=HTTPStatus.NOT_FOUND,
error='Widget not found',
)
return widget.engagement_id

@staticmethod
Original file line number Diff line number Diff line change
@@ -30,17 +30,12 @@ def get_subscribe_item_translation(subscribe_item_id=None, language_id=None):
def get_engagement_id(widget_subscribe_id):
"""Get engagement id widget_subscribe_id."""
widget_subscribe = WidgetSubscribeService.get_by_id(widget_subscribe_id)
if not widget_subscribe_id:
if not widget_subscribe:
raise BusinessException(
status_code=HTTPStatus.NOT_FOUND,
error='Subscribe widget not found',
)
widget = WidgetService.get_widget_by_id(widget_subscribe.widget_id)
if not widget:
raise BusinessException(
status_code=HTTPStatus.NOT_FOUND,
error='Widget not found',
)
return widget.engagement_id

@staticmethod
6 changes: 3 additions & 3 deletions met-api/tests/utilities/factory_scenarios.py
Original file line number Diff line number Diff line change
@@ -942,7 +942,7 @@ class TestSubscribeItemTranslationInfo(dict, Enum):
translate_info1 = {
'subscribe_item_id': 1,
'language_id': 2,
'description': 'Description in another language',
'description': fake.text(),
}


@@ -952,7 +952,7 @@ class TestEventItemTranslationInfo(dict, Enum):
event_item_info1 = {
'event_item_id': 1,
'language_id': 2,
'description': 'Description in another language',
'description': fake.text(),
'location_name': 'Location name',
'location_address': 'location address',
'url': fake.url(),
@@ -966,7 +966,7 @@ class TestTimelineEventTranslationInfo(dict, Enum):
timeline_event_info1 = {
'timeline_event_id': 1,
'language_id': 2,
'description': 'Description in another language',
'description': fake.text(),
'time': datetime.now().strftime('%Y-%m-%d'),
}

0 comments on commit 1045b42

Please sign in to comment.