only migrate harvest sources which are active

This commit is contained in:
kindly 2013-06-28 02:32:45 +01:00
parent a42991b8c9
commit c2283e3fdb
1 changed files with 2 additions and 2 deletions

View File

@ -72,8 +72,8 @@ def setup():
migrate_v3() migrate_v3()
# Check if this instance has harvest source datasets # Check if this instance has harvest source datasets
source_ids = Session.query(HarvestSource.id).all() source_ids = Session.query(HarvestSource.id).filter_by(active=True).all()
source_package_ids = Session.query(model.Package.id).filter(model.Package.type==u'harvest').all() source_package_ids = Session.query(model.Package.id).filter_by(type=u'harvest', state='active').all()
sources_to_migrate = set(source_ids) - set(source_package_ids) sources_to_migrate = set(source_ids) - set(source_package_ids)
if sources_to_migrate: if sources_to_migrate:
log.debug('Creating harvest source datasets for %i existing sources', len(sources_to_migrate)) log.debug('Creating harvest source datasets for %i existing sources', len(sources_to_migrate))