From 71689d4c8ca1419c1686c9d8d4ce33eb442c914a Mon Sep 17 00:00:00 2001 From: Nicola Iarocci Date: Tue, 8 Nov 2022 16:00:15 +0100 Subject: [PATCH] fix: comparison of incompatible types. Addresses #1492 --- CHANGES.rst | 4 +++- eve/methods/common.py | 6 +----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 869b49af6..1213d1685 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -6,7 +6,9 @@ Here you can see the full list of changes between each Eve release. In Development --------------- -- hic sunt leones. +- Fix: comparison of incompatible types (`#1492`_) + +.. _`#1492`: https://github.com/pyeve/eve/issues/1492 Version v2.0.3 -------------- diff --git a/eve/methods/common.py b/eve/methods/common.py index 220fc42da..bca5118a1 100644 --- a/eve/methods/common.py +++ b/eve/methods/common.py @@ -754,11 +754,7 @@ def resolve_data_relation_links(document, resource): if "data_relation" not in field_def: continue - if ( - field in document - and document[field] is not None - and document[field] is not [] - ): + if field in document and document[field] is not None and document[field] != []: related_links = [] # Make the code DRY for list of linked relation and single linked relation