summaryrefslogtreecommitdiffstats
path: root/sitemaps.py
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 /sitemaps.py
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 'sitemaps.py')
-rw-r--r--sitemaps.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/sitemaps.py b/sitemaps.py
index 176d8b4f..33eb0064 100644
--- a/sitemaps.py
+++ b/sitemaps.py
@@ -16,7 +16,7 @@ class PackagesSitemap(Sitemap):
return Package.objects.normal().only(
'pkgname', 'last_update', 'files_last_update',
'repo__name', 'repo__testing', 'repo__staging',
- 'arch__name').order_by()
+ 'arch__name')
def lastmod(self, obj):
return obj.last_update
@@ -81,7 +81,7 @@ class NewsSitemap(Sitemap):
self.one_week_ago = now - timedelta(days=7)
def items(self):
- return News.objects.all().defer('content', 'guid', 'title').order_by()
+ return News.objects.all().defer('content', 'guid', 'title')
def lastmod(self, obj):
return obj.last_modified
@@ -110,7 +110,7 @@ class ReleasesSitemap(Sitemap):
changefreq = "monthly"
def items(self):
- return Release.objects.all().defer('info', 'torrent_data').order_by()
+ return Release.objects.all().defer('info', 'torrent_data')
def lastmod(self, obj):
return obj.last_modified
@@ -129,7 +129,7 @@ class TodolistSitemap(Sitemap):
self.two_weeks_ago = now - timedelta(days=14)
def items(self):
- return Todolist.objects.all().defer('raw').order_by()
+ return Todolist.objects.all().defer('raw').order_by('created')
def lastmod(self, obj):
return obj.last_modified