Skip to content

Commit

Permalink
Upgrade: Get back the checks before calling upgrade
Browse files Browse the repository at this point in the history
Also did some cleanups to remove unnecessary code and polished code.
  • Loading branch information
unho committed Apr 23, 2014
1 parent 001c0cb commit d634d6d
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions pootle/apps/pootle_app/management/commands/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,26 +114,25 @@ def handle(self, *args, **options):
tt_changed = db_tt_buildversion < CODE_TTK_BUILDVERSION

if ptl_changed or tt_changed:
from pootle_misc.upgrade import upgrade

if ptl_changed:
logging.info('Detected new Pootle version: %d.',
CODE_PTL_BUILDVERSION)
else:
db_ptl_buildversion = 0

if tt_changed:
logging.info('Detected new Translate Toolkit version: %d.',
CODE_TTK_BUILDVERSION)
else:
db_tt_buildversion = 0

logging.info('Running the upgrade machinery...')

from pootle_misc.upgrade import upgrade
if ptl_changed:
upgrade('pootle', db_ptl_buildversion, CODE_PTL_BUILDVERSION)

upgrade('pootle', db_ptl_buildversion, CODE_PTL_BUILDVERSION)
upgrade('ttk', db_tt_buildversion, CODE_TTK_BUILDVERSION)
if tt_changed:
upgrade('ttk', db_tt_buildversion, CODE_TTK_BUILDVERSION)

# Perform the option related actions.
if options['calculate_stats']:
calculate_stats()

Expand Down

0 comments on commit d634d6d

Please sign in to comment.