Created
December 7, 2011 23:04
-
-
Save andymckay/1445190 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import amo | |
from addons.models import Addon | |
# Guids to update from builder. | |
guids = [] | |
# Builder version to set. | |
id = '' | |
def run(): | |
for guid in guids: | |
try: | |
addon = Addon.objects.get(pk=guid, auto_repackage=True, | |
disabled_by_user=False, | |
status__in=amo.VALID_STATUSES) | |
except Addon.DoesNotExist: | |
print 'Addon with guid %s does not exist' % guid | |
continue | |
file_ = addon.current_version.order_by('-pk')[0] | |
file_.update(builder_version=id) | |
print 'Updating file %s for addon %s' % (file_.pk, guid) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment