From f04f3519d415f53a9d5d27374d6e0c0d0d49f618 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 3 Aug 2022 13:54:08 +0200 Subject: [PATCH] misc: do not advertise live key for cards/users sourced item (#67955) --- wcs/variables.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/wcs/variables.py b/wcs/variables.py index 0eb299898..a50910d73 100644 --- a/wcs/variables.py +++ b/wcs/variables.py @@ -1000,7 +1000,11 @@ class LazyFieldVarStructured(LazyFieldVarComplex, LazyFieldVarLiveCardMixin): if not self._data.get(self._field.id): return [] real_data_source = self._field.get_real_data_source() - if real_data_source and real_data_source.get('type', '') == 'wcs:users': + if ( + real_data_source + and self._field.type == 'item' + and real_data_source.get('type', '') == 'wcs:users' + ): return ['raw', 'live'] structured_value = self._field.get_structured_value(self._data) @@ -1008,7 +1012,11 @@ class LazyFieldVarStructured(LazyFieldVarComplex, LazyFieldVarLiveCardMixin): return ['raw'] keys = ['raw', 'structured'] - if real_data_source and real_data_source.get('type', '').startswith('carddef:'): + if ( + real_data_source + and self._field.type == 'item' + and real_data_source.get('type', '').startswith('carddef:') + ): try: self.live except AttributeError: