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

Testing dev server view error response #2370

Merged
merged 1 commit into from
Jan 31, 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
7 changes: 2 additions & 5 deletions met-api/src/met_api/resources/widget_poll.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""API endpoints for managing a poll widget resource."""
from http import HTTPStatus

from flask import request
from flask import jsonify, request
from flask_cors import cross_origin
from flask_restx import Namespace, Resource

Expand Down Expand Up @@ -29,10 +29,7 @@ def get(widget_id):
"""Get poll widgets."""
try:
widget_poll = WidgetPollService().get_polls_by_widget_id(widget_id)
return (
WidgetPollSchema().dump(widget_poll, many=True),
HTTPStatus.OK,
)
return jsonify(WidgetPollSchema().dump(widget_poll, many=True)), HTTPStatus.OK
except BusinessException as err:
return str(err), err.status_code

Expand Down
Loading