Fix #628 -- Sorting of filtered order list (#631)

* fix sorting of filtered order list

fixes #628

* implement comments on pr
This commit is contained in:
Jakob Schnell
2017-10-02 14:55:02 +02:00
committed by Raphael Michel
parent 457901ff82
commit fd5d5ae98e
2 changed files with 10 additions and 7 deletions

View File

@@ -70,13 +70,6 @@ class OrderList(EventPermissionRequiredMixin, ListView):
if self.filter_form.is_valid():
qs = self.filter_form.filter_qs(qs)
if self.request.GET.get("ordering", "") != "":
p = self.request.GET.get("ordering", "")
p_admissable = ('-code', 'code', '-email', 'email', '-total', 'total', '-datetime',
'datetime', '-status', 'status', 'pcnt', '-pcnt')
if p in p_admissable:
qs = qs.order_by(p)
return qs.distinct()
def get_context_data(self, **kwargs):