From f9328b79c5479d06cbe5c287aada383a8a9eeded Mon Sep 17 00:00:00 2001 From: Lukas Erlacher Date: Mon, 8 Jan 2018 10:58:55 +1100 Subject: [PATCH] Fix #43 Fixes a bad if condition that doesn't work --- sqlalchemy_jsonapi/serializer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sqlalchemy_jsonapi/serializer.py b/sqlalchemy_jsonapi/serializer.py index bcda40e..95d6b67 100644 --- a/sqlalchemy_jsonapi/serializer.py +++ b/sqlalchemy_jsonapi/serializer.py @@ -1043,7 +1043,7 @@ def post_collection(self, session, data, api_type): raise BadRequestError( '{} must be an array'.format(key)) for item in data_rel: - if not {'type', 'id'} in set(item.keys()): + if 'type' not in item.keys() or 'id' not in item.keys(): raise BadRequestError( '{} must have type and id keys'.format(key)) # pragma: no cover