vars: set _was_touched
when updating cached vars (#2886)
Ensure that updated cached vars are persisted into redis.
This commit is contained in:
parent
1a66e145b5
commit
6a071a27e2
@ -1861,6 +1861,8 @@ class ComputedVar(Var, property):
|
|||||||
# handle caching
|
# handle caching
|
||||||
if not hasattr(instance, self._cache_attr):
|
if not hasattr(instance, self._cache_attr):
|
||||||
setattr(instance, self._cache_attr, super().__get__(instance, owner))
|
setattr(instance, self._cache_attr, super().__get__(instance, owner))
|
||||||
|
# Ensure the computed var gets serialized to redis.
|
||||||
|
instance._was_touched = True
|
||||||
return getattr(instance, self._cache_attr)
|
return getattr(instance, self._cache_attr)
|
||||||
|
|
||||||
def _deps(
|
def _deps(
|
||||||
|
Loading…
Reference in New Issue
Block a user