Skip to content

Commit 5802a83

Browse files
Dmitry Mishanovmahenzon
andcommitted
Small fix for ResourceList.post
Co-authored-by: Suren Khorenyan <surenkhorenyan@gmail.com>
1 parent 943282a commit 5802a83

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

flask_combo_jsonapi/resource.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def post(self, *args, **kwargs):
185185
else:
186186
result = schema.dump(obj)
187187

188-
if result["data"].get("links", {}).get("self"):
188+
if (result["data"] or {}).get("links", {}).get("self"):
189189
final_result = (result, 201, {"Location": result["data"]["links"]["self"]})
190190
else:
191191
final_result = (result, 201)

0 commit comments

Comments
 (0)