Fixed issue with ordering breaking if there is no order is set in the URL

This commit is contained in:
tomtom5152
2014-11-05 14:06:37 +00:00
parent 7c87d5781f
commit c624b91d18

View File

@@ -76,7 +76,7 @@ def orderby(request, field, attr):
dict_ = request.GET.copy()
if dict_[field] == attr:
if dict_.__contains__(field) and dict_[field] == attr:
if not dict_[field].startswith("-"):
dict_[field] = "-" + attr
else: