diff --git a/downloads/templatetags/download_tags.py b/downloads/templatetags/download_tags.py index fb3496787..263aa9a5f 100644 --- a/downloads/templatetags/download_tags.py +++ b/downloads/templatetags/download_tags.py @@ -14,3 +14,21 @@ def has_sigstore_materials(files): f.sigstore_bundle_file or f.sigstore_cert_file or f.sigstore_signature_file for f in files ) + + +@register.filter +def prioritise_64bit_over_32bit(files): + if not files: + return files + + # Put 64-bit files before 32-bit + new = [] + previous = files[0] + for i, current in enumerate(files): + if i >= 1 and '(64-bit)' in current.name and '(32-bit)' in previous.name: + new.insert(-1, current) + else: + new.append(current) + previous = current + + return new diff --git a/templates/downloads/os_list.html b/templates/downloads/os_list.html index 67db5233f..b4c42c6d9 100644 --- a/templates/downloads/os_list.html +++ b/templates/downloads/os_list.html @@ -1,6 +1,7 @@ {% extends "downloads/base.html" %} {% load boxes %} {% load sitetree %} +{% load prioritise_64bit_over_32bit from download_tags %} {% block body_attributes %}class="python download"{% endblock %} @@ -45,7 +46,7 @@

Stable Releases

{% endif %} {% endif %}