diff --git a/apps/common/drf/metadata.py b/apps/common/drf/metadata.py index f29fa0c83..cae11cab3 100644 --- a/apps/common/drf/metadata.py +++ b/apps/common/drf/metadata.py @@ -84,8 +84,7 @@ class SimpleMetadataWithFilters(SimpleMetadata): def get_filters_fields(self, request, view): fields = [] if hasattr(view, 'get_filter_fields'): - # fields = view.get_filter_fields(request) - fields = view.get_filter_fields() + fields = view.get_filter_fields(request) elif hasattr(view, 'filter_fields'): fields = view.filter_fields return fields @@ -93,9 +92,9 @@ class SimpleMetadataWithFilters(SimpleMetadata): def get_ordering_fields(self, request, view): fields = [] if hasattr(view, 'get_ordering_fields'): - fields = view.get_filter_fields(request) + fields = view.get_ordering_fields(request) elif hasattr(view, 'ordering_fields'): - fields = view.filter_fields + fields = view.ordering_fields return fields def determine_metadata(self, request, view): diff --git a/apps/terminal/api/command.py b/apps/terminal/api/command.py index 1bfa122eb..eb0955648 100644 --- a/apps/terminal/api/command.py +++ b/apps/terminal/api/command.py @@ -63,7 +63,7 @@ class CommandQueryMixin: def filter_queryset(self, queryset): return queryset - def get_filter_fields(self): + def get_filter_fields(self, request): fields = self.filter_fields fields.extend(["date_from", "date_to"]) return fields