Commit c6052463 authored by Antoine Millet's avatar Antoine Millet
Browse files

Fixed cache updated when not needed in CallbackTag

parent 9f295928
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -107,7 +107,8 @@ class CallbackTag(BaseTag, StaticTagInterface):

    @property
    def value(self):
        if self.ttl is not None or self.ttl is None and self._cache_last_update is None:
        # Update the cached value if it has expired or not retrieved yet:
        if self.ttl is not None or (self.ttl is None and self._cache_last_update is None):
            if self._cache_last_update is None or datetime.now() - self._cache_last_update > self.ttl:
                self.value = str(self.callback(**self._callback_extra))
        return self._cache_value