From 0bbc23853de5e77bc470a164fcb5cb7fea557c54 Mon Sep 17 00:00:00 2001 From: Arona Date: Tue, 26 May 2020 13:42:37 +0100 Subject: [PATCH] Well that wasn't clever of me --- PyRIGS/views.py | 2 +- RIGS/rigboard.py | 2 +- RIGS/tests/regions.py | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/PyRIGS/views.py b/PyRIGS/views.py index 565be96b..4afed9d5 100644 --- a/PyRIGS/views.py +++ b/PyRIGS/views.py @@ -156,6 +156,6 @@ class GenericListView(generic.ListView): object_list = self.model.objects.filter(filter) orderBy = self.request.GET.get('orderBy', "name") - if orderBy is not "": + if orderBy != "": object_list = object_list.order_by(orderBy) return object_list diff --git a/RIGS/rigboard.py b/RIGS/rigboard.py index 764de702..d4474e55 100644 --- a/RIGS/rigboard.py +++ b/RIGS/rigboard.py @@ -262,7 +262,7 @@ class EventArchive(generic.ListView): q = self.request.GET.get('q', "") - if q is not "": + if q != "": qfilter = Q(name__icontains=q) | Q(description__icontains=q) | Q(notes__icontains=q) # try and parse an int diff --git a/RIGS/tests/regions.py b/RIGS/tests/regions.py index c5a4d3be..4a305298 100644 --- a/RIGS/tests/regions.py +++ b/RIGS/tests/regions.py @@ -5,7 +5,7 @@ from selenium.webdriver.remote.webelement import WebElement from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support.select import Select import datetime -from PyRIGS.regions import Modal +from PyRIGS.tests.regions import Modal class Header(Region): @@ -40,6 +40,7 @@ class ItemRow(Region): def subtotal(self): return self.find_element(*self._subtotal_locator).text + class ItemModal(Modal): _header_selector = (By.TAG_NAME, 'h4')