diff --git a/horilla_views/generic/cbv/history.py b/horilla_views/generic/cbv/history.py index 0769ec69a..ab4cc6b85 100644 --- a/horilla_views/generic/cbv/history.py +++ b/horilla_views/generic/cbv/history.py @@ -2,15 +2,16 @@ horilla_views/generic/cbv/history.py """ -from django.views.generic import DetailView -from django.contrib import messages from django.apps import apps +from django.contrib import messages from django.utils.decorators import method_decorator +from django.views.generic import DetailView from simple_history.utils import get_history_model_for_model -from horilla_views.history_methods import get_diff -from horilla_views.generic.cbv.views import HorillaFormView -from horilla_views.cbv_methods import hx_request_required + from horilla.horilla_middlewares import _thread_locals +from horilla_views.cbv_methods import hx_request_required +from horilla_views.generic.cbv.views import HorillaFormView +from horilla_views.history_methods import get_diff @method_decorator(hx_request_required, name="dispatch") diff --git a/horilla_views/templates/generic/horilla_history_view.html b/horilla_views/templates/generic/horilla_history_view.html index 8447e790a..01d162a92 100644 --- a/horilla_views/templates/generic/horilla_history_view.html +++ b/horilla_views/templates/generic/horilla_history_view.html @@ -57,7 +57,7 @@ } })"> - + {% endif %} {% endif %} @@ -86,11 +86,10 @@
{% trans 'No history found.' %}
- + {% comment %}
{% trans 'No history found.' %}
{% endcomment %} {% endif %} - \ No newline at end of file diff --git a/horilla_views/templatetags/generic_template_filters.py b/horilla_views/templatetags/generic_template_filters.py index aa0fa22c7..51038f824 100644 --- a/horilla_views/templatetags/generic_template_filters.py +++ b/horilla_views/templatetags/generic_template_filters.py @@ -6,6 +6,7 @@ This module is used to write custom template filters. """ import datetime +import functools import re import types @@ -74,7 +75,7 @@ def getattribute(value, attr: str): result.append(getattribute(record, attr)) elif hasattr(value, str(attr)): result = getattr(value, attr) - if isinstance(result, types.MethodType): + if isinstance(result, (types.MethodType, functools.partial)): result = result() value = result else: