Commit 70b9eb48 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

ordered_projects: ensure py-XX is after XX

parent 1c107930
Pipeline #5599 passed with stage
in 41 seconds
......@@ -1184,4 +1184,13 @@ def ordered_projects():
ret = Project.objects.filter(Q(id__in=ret) | Q(id__in=[ for p in new_ret]))
rest = rest.exclude(id__in=[ for p in new_ret])
print(ret.count(), rest.count())
# Ensure that py-XX is after XX
switch = []
for i, (cat, pkg) in enumerate(lst):
if pkg.startswith('py-') and [cat, pkg[3:]] in lst and i < lst.index([cat, pkg[3:]]):
switch.append((i, lst.index([cat, pkg[3:]])))
for old, new in switch:
lst[old], lst[new] = lst[new], lst[old]
return lst
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment