[FIX] HORILLA_VIEWS: #874
This commit is contained in:
@@ -102,7 +102,15 @@ def format(string: str, instance: object):
|
|||||||
attr_name: str = attr_placeholder
|
attr_name: str = attr_placeholder
|
||||||
attrs = attr_name.split("__")
|
attrs = attr_name.split("__")
|
||||||
for attr in attrs:
|
for attr in attrs:
|
||||||
value = getattr(instance, attr, "")
|
if (
|
||||||
|
attr.startswith("get_")
|
||||||
|
and attr.endswith("_display")
|
||||||
|
and callable(getattr(instance, attr, None))
|
||||||
|
): # 874
|
||||||
|
value = getattr(instance, attr)()
|
||||||
|
else:
|
||||||
|
value = getattr(instance, attr, "")
|
||||||
|
|
||||||
if isinstance(value, types.MethodType):
|
if isinstance(value, types.MethodType):
|
||||||
value = value()
|
value = value()
|
||||||
instance = value
|
instance = value
|
||||||
|
|||||||
Reference in New Issue
Block a user