API: fix downloads list sort

This commit is contained in:
simon 2022-04-21 05:45:55 +07:00
parent 1477370376
commit b76f38e0bc
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4

View File

@ -364,9 +364,7 @@ class DownloadApiListView(ApiBaseView):
def get(self, request): def get(self, request):
"""get request""" """get request"""
query_filter = request.GET.get("filter", False) query_filter = request.GET.get("filter", False)
self.data.update = { self.data.update({"sort": [{"timestamp": {"order": "asc"}}]})
"sort": [{"timestamp": {"order": "asc"}}],
}
if query_filter: if query_filter:
if query_filter not in self.valid_filter: if query_filter not in self.valid_filter:
message = f"invalid url query filder: {query_filter}" message = f"invalid url query filder: {query_filter}"