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 d4cb5004df
commit 1d2bc6df7c

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: