From 1d2bc6df7c7d714b5a7e562a01e02d61221ebdca Mon Sep 17 00:00:00 2001 From: tomtom5152 Date: Wed, 5 Nov 2014 14:06:37 +0000 Subject: [PATCH] Fixed issue with ordering breaking if there is no order is set in the URL --- RIGS/templatetags/filters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RIGS/templatetags/filters.py b/RIGS/templatetags/filters.py index a6be41ae..404bbd5e 100644 --- a/RIGS/templatetags/filters.py +++ b/RIGS/templatetags/filters.py @@ -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: