summaryrefslogtreecommitdiffstats
path: root/todolists/utils.py
diff options
context:
space:
mode:
authorJustin ! <just1602@riseup.net>2020-10-04 00:59:41 -0400
committerjelle van der Waa <jelle@vdwaa.nl>2020-11-11 22:23:29 +0100
commitc6cf91a40df69341dca8cec5e5971ff21cca0e04 (patch)
tree4f3a9de22010a5fd6e10a2d38801635b6d4f8b00 /todolists/utils.py
parent34de88278fc4bbcc72f83be4b40df881735f8a35 (diff)
downloadarchweb-c6cf91a40df69341dca8cec5e5971ff21cca0e04.tar.gz
archweb-c6cf91a40df69341dca8cec5e5971ff21cca0e04.zip
Fix pep8 errors
Diffstat (limited to 'todolists/utils.py')
-rw-r--r--todolists/utils.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/todolists/utils.py b/todolists/utils.py
index c090520f..6dc68077 100644
--- a/todolists/utils.py
+++ b/todolists/utils.py
@@ -21,7 +21,7 @@ SELECT todolist_id, count(*), SUM(CASE WHEN status = %s THEN 1 ELSE 0 END)
def get_annotated_todolists(incomplete_only=False):
lists = Todolist.objects.all().defer('raw').select_related(
- 'creator').order_by('-created')
+ 'creator').order_by('-created')
lookup = todo_counts()
# tag each list with package counts
@@ -32,7 +32,7 @@ def get_annotated_todolists(incomplete_only=False):
todolist.incomplete_count = counts[0] - counts[1]
if incomplete_only:
- lists = [l for l in lists if l.incomplete_count > 0]
+ lists = [lst for lst in lists if lst.incomplete_count > 0]
else:
lists = sorted(lists, key=lambda todolist: todolist.incomplete_count == 0)
return lists
@@ -42,9 +42,9 @@ def attach_staging(packages, list_id):
'''Look for any staging version of the packages provided and attach them
to the 'staging' attribute on each package if found.'''
pkgnames = TodolistPackage.objects.filter(
- todolist_id=list_id).values('pkgname')
+ todolist_id=list_id).values('pkgname')
staging_pkgs = Package.objects.normal().filter(repo__staging=True,
- pkgname__in=pkgnames)
+ pkgname__in=pkgnames)
# now build a lookup dict to attach to the correct package
lookup = {(p.pkgname, p.arch): p for p in staging_pkgs}