From f74979bb0caf0a3a1b72f727cde6616b3e9c6d05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 19 Feb 2020 16:40:59 +0100 Subject: [PATCH] misc: mark json cell that are dependant on user (#40033) --- combo/data/models.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/combo/data/models.py b/combo/data/models.py index 66d297f6..81c8aa9a 100644 --- a/combo/data/models.py +++ b/combo/data/models.py @@ -1167,6 +1167,13 @@ class JsonCellBase(CellBase): def is_visible(self, user=None): return bool(self.url) and super(JsonCellBase, self).is_visible(user=user) + def is_user_dependant(self): + urls = [self.url] + [x['url'] for x in self.additional_data or []] + for url in urls: + if url and ('user_nameid' in url or 'user_email' in url): + return True + return False + def get_cell_parameters_context(self): return {}