Skip to content

Commit 841d392

Browse files
author
Joel Collins
committed
Handle missing endpoint in view_class_from_endpoint
1 parent eb51204 commit 841d392

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

labthings/server/utilities.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def view_class_from_endpoint(endpoint: str):
5555
Returns:
5656
View: View class attached to the specified endpoint
5757
"""
58-
return current_app.view_functions[endpoint].view_class
58+
return getattr(current_app.view_functions.get(endpoint), "view_class", None)
5959

6060

6161
def unpack(value):

0 commit comments

Comments
 (0)