Skip to content

Commit

Permalink
No need to print migration message on fresh ckan install (eg travis)
Browse files Browse the repository at this point in the history
  • Loading branch information
David Read committed May 3, 2019
1 parent 32080c1 commit e1eee9a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions ckan/migration/versions/089_package_activity_migration_check.py
Expand Up @@ -16,17 +16,23 @@ def upgrade(migrate_engine):
should run the package activity migration, so that the Activity Stream can
display the detailed history of datasets:
python migrate_package_activity.py -c /etc/ckan/production.ini
python migrate_package_activity.py -c /etc/ckan/production.ini
Once you've done that, the detailed history is visible in Activity Stream
to *admins only*. However you are encouraged to make it available to the
public, by setting this in production.ini:
ckan.auth.public_activity_stream_detail = true
ckan.auth.public_activity_stream_detail = true
More information about all of this is here:
https://github.com/ckan/ckan/wiki/Migrate-package-activity
'''.format(num_unmigrated=num_unmigrated_dataset_activities))
else:
print(u'You have no unmigrated package activities - you do not need to'
'run migrate_package_activity.py.')
# there are no unmigrated package activities
are_any_datasets = bool(
migrate_engine.execute(u'SELECT id FROM PACKAGE LIMIT 1').rowcount)
# no need to tell the user if there are no datasets - this could just
# be a fresh CKAN install
if are_any_datasets:
print(u'You have no unmigrated package activities - you do not '
'need to run migrate_package_activity.py.')

0 comments on commit e1eee9a

Please sign in to comment.