Skip to content

Commit a514457

Browse files
committed
added try catch for schema to prevent attribute error
1 parent a97139a commit a514457

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/senaite/jsonapi/dataproviders.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,10 @@ def __init__(self, context):
222222

223223
# get the schema fields from the data manager
224224
schema = api.get_schema(context)
225-
self.keys = schema.keys()
225+
try:
226+
self.keys = schema.keys()
227+
except AttributeError:
228+
self.keys = schema.__dict__.keys()
226229

227230

228231
class SiteRootDataProvider(Base):

0 commit comments

Comments
 (0)