Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Commit

Permalink
copy files to the mirror if necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Balogh committed May 24, 2011
1 parent bfd1507 commit d2f2599
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions apps/addons/cron.py
Expand Up @@ -283,9 +283,13 @@ def unhide_disabled_files():
if tuple([int(addon), filename]) not in files:
log.warning('File that should not be guarded: %s.' % filepath)
try:
file_ = File.objects.get(version__addon=addon,
filename=filename)
file_ = (File.objects.get(version__addon=addon,
filename=filename)
.select_related('version__addon'))
file_.unhide_disabled_file()
if (file_.version.addon.status in amo.MIRROR_STATUSES
and file_.status in amo.MIRROR_STATUSES):
file_.copy_to_mirror()
except File.DoesNotExist:
log.warning('File does not exist: %s.' % filepath)
except Exception:
Expand Down

0 comments on commit d2f2599

Please sign in to comment.