Created
April 22, 2015 17:39
-
-
Save kmaglione/9de05246a3e9ae91ab79 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- tasks.py 2015-04-22 10:25:34.540149094 -0700 | |
+++ - 2015-04-22 10:39:27.891606615 -0700 | |
@@ -26,12 +26,24 @@ | |
installs it. | |
""" | |
log.info('[{0}] Signing addons.'.format(len(addon_ids))) | |
+ | |
+ def supports_firefox(version): | |
+ return Q(version__max__application=amo.FIREFOX.id, | |
+ version__max__version_int__gte=version_int(version)) | |
+ | |
+ is_default_compatible = Q(binary_components=False, | |
+ strict_compatibility=False) | |
+ filter = ((is_default_compatible & supports_firefox('10')) | | |
+ (~is_default_compatible & supports_firefox('39'))) | |
+ | |
+ | |
for version in Version.objects.filter(addon_id__in=addon_ids, | |
addon__type=amo.ADDON_EXTENSION): | |
+ to_sign = version.files.filter(filter) | |
if force: | |
- to_sign = version.files.all() | |
+ to_sign = to_sign.all() | |
else: | |
- to_sign = [f for f in version.files.all() if not f.is_signed] | |
+ to_sign = [f for f in to_sign.all() if not f.is_signed] | |
if not to_sign: | |
log.info('Not signing addon {0}, version {1} (no files or already ' | |
'signed)'.format(version.addon, version)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment