From 34e7a86130dab00687013a4c0d5e3aca96fff858 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Thu, 4 Apr 2019 19:34:16 +0200 Subject: [PATCH] index is an str --- tiramisu_json_api/api.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tiramisu_json_api/api.py b/tiramisu_json_api/api.py index 8026194..67df2dd 100644 --- a/tiramisu_json_api/api.py +++ b/tiramisu_json_api/api.py @@ -627,7 +627,6 @@ class Config: def is_hidden(self, path: str, index: Optional[int]) -> bool: - property_ = 'hidden' for property_, needs in {'hidden': True, 'display': False}.items(): if property_ in self.temp.get(path, {}): value = self.temp[path][property_] @@ -638,7 +637,7 @@ class Config: elif self.model.get(path, {}).get(property_, None) == needs: return True index = str(index) - if index is not None and index in self.model.get(path, {}) and self.model.get(path, {}).get(index, {}).get(property_, None) == needs: + if index != 'None' and index in self.model.get(path, {}) and self.model.get(path, {}).get(index, {}).get(property_, None) == needs: return True return False