misc: do not advertise live key for cards/users sourced item (#67955)

This commit is contained in:
Frédéric Péters 2022-08-03 13:54:08 +02:00
parent d4b115cbe5
commit f04f3519d4
1 changed files with 10 additions and 2 deletions

View File

@ -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: