Skip to content

Commit 44bcb2a

Browse files
author
Joel Collins
committed
Only add GET method if static path is given
1 parent f5583bd commit 44bcb2a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

labthings/server/view/builder.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from labthings.server.decorators import ThingProperty, PropertySchema, Doc
33
from . import View
44

5-
from flask import send_from_directory
5+
from flask import send_from_directory, abort
66
import uuid
77

88

@@ -74,6 +74,9 @@ def _get(self, path):
7474
return send_from_directory(static_folder, path)
7575

7676
# Generate a basic property class
77-
generated_class = type(name, (View, object), {"get": _get,},)
77+
generated_class = type(name, (View, object), {},)
78+
79+
if static_folder:
80+
generated_class.get = _get
7881

7982
return generated_class

0 commit comments

Comments
 (0)