mirror of
https://github.com/OCA/knowledge.git
synced 2025-08-28 10:16:13 -06:00
fix unit tests
This commit is contained in:
parent
f74bf47e70
commit
f0ef1bcce4
@ -23,12 +23,10 @@ try:
|
||||
class Context(SandboxedEnvironment.context_class):
|
||||
def resolve_or_missing(self, key):
|
||||
res = super().resolve_or_missing(key)
|
||||
if res is not Undefined:
|
||||
if not isinstance(res, Undefined):
|
||||
return res
|
||||
try:
|
||||
return self.parent["ref"](key)
|
||||
except KeyError:
|
||||
return Undefined()
|
||||
# If the key is not found in the normal context, try to resolve it as a reference
|
||||
return self.parent["ref"](key)
|
||||
|
||||
class Environment(SandboxedEnvironment):
|
||||
context_class = Context
|
||||
|
Loading…
Reference in New Issue
Block a user