fix pre-commit

This commit is contained in:
Jan Suhr 2025-07-28 11:56:29 +02:00
parent 71a2c9b51f
commit 5825662e4d

View File

@ -34,11 +34,13 @@ try:
if not isinstance(res, Undefined): if not isinstance(res, Undefined):
return res return res
except AttributeError: except AttributeError:
pass _logger.debug(
"Neither resolve_or_missing nor resolve method available in parent context"
)
# If the key is not found in the normal context, try to resolve it as a reference # If the key is not found in the normal context, try to resolve it as a reference
return self.parent["ref"](key) return self.parent["ref"](key)
# Keep the old method for backward compatibility # Keep the old method for backward compatibility
def resolve(self, key): def resolve(self, key):
return self.resolve_or_missing(key) return self.resolve_or_missing(key)
@ -144,7 +146,8 @@ class DocumentPage(models.Model):
return template.render(self._get_template_variables()) return template.render(self._get_template_variables())
except Exception as e: except Exception as e:
_logger.error( _logger.error(
"Template from page with id = %s cannot be processed: %s" % (self.id, str(e)) "Template from page with id = %s cannot be processed: %s"
% (self.id, str(e))
) )
return self.content return self.content