summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorFrank Vanderham <twelve.eighty@gmail.com>2018-04-27 09:07:52 -0600
committerJelle van der Waa <jelle@vdwaa.nl>2018-05-07 21:47:42 +0200
commite137256183d1ed10e43f417962614cbb2aa278bc (patch)
treeb7c02a2a8c67dcae0ce104ec53b72ebf6e252715 /packages
parentb94a36e7c62fe9be8d35d0e85088798a28ba6d61 (diff)
downloadarchweb-e137256183d1ed10e43f417962614cbb2aa278bc.tar.gz
archweb-e137256183d1ed10e43f417962614cbb2aa278bc.zip
Remove calls to order_by() without parameters
Calls to order_by() without passing any parameters was causing UnorderedObjectListWarning during unit tests. The failing unit tests were testing the sitemap functionality. Sitemaps utilize Paginators, which require either the entity ordering as specified in their Meta object, or a specific ordering in the QuerySet, otherwise this warning is issued.
Diffstat (limited to 'packages')
-rw-r--r--packages/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/utils.py b/packages/utils.py
index 86612d21..ccf5e1b5 100644
--- a/packages/utils.py
+++ b/packages/utils.py
@@ -78,7 +78,7 @@ def get_split_packages_info():
pkgnames = Package.objects.values('pkgname')
split_pkgs = Package.objects.exclude(pkgname=F('pkgbase')).exclude(
pkgbase__in=pkgnames).values('pkgbase', 'repo', 'arch').annotate(
- last_update=Max('last_update')).order_by().distinct()
+ last_update=Max('last_update')).distinct()
all_arches = Arch.objects.in_bulk({s['arch'] for s in split_pkgs})
all_repos = Repo.objects.in_bulk({s['repo'] for s in split_pkgs})
for split in split_pkgs: