Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/DESENG-515-MultiLangEvent' into …
Browse files Browse the repository at this point in the history
…DESENG-515-MultiLangEventFinal
  • Loading branch information
ratheesh-aot committed Mar 15, 2024
2 parents 1c946c4 + 1045b42 commit 09e929a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions met-api/tests/utilities/factory_scenarios.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}


Expand All @@ -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(),
Expand All @@ -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'),
}

Expand Down

0 comments on commit 09e929a

Please sign in to comment.