Skip to content

Commit c8dfbc5

Browse files
authored
Merge pull request #33 from AdCombo/hotfix-resource-detail-not-found
Fix resource detail not found
2 parents aeb9d13 + 86dbb59 commit c8dfbc5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

flask_combo_jsonapi/resource.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,10 @@ def post(self, *args, **kwargs):
188188

189189
obj = self.create_object(data, kwargs)
190190

191-
result = schema.dump(obj)
191+
if obj is None:
192+
result = {"data": None}
193+
else:
194+
result = schema.dump(obj)
192195

193196
if result["data"].get("links", {}).get("self"):
194197
final_result = (result, 201, {"Location": result["data"]["links"]["self"]})

0 commit comments

Comments
 (0)