Skip to content

Commit

Permalink
Minor script updates; update release date
Browse files Browse the repository at this point in the history
  • Loading branch information
sloria committed Apr 21, 2017
1 parent 1e9159c commit ae68cc1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Changelog
*********

0.106.0 (2017-04-20)
0.106.0 (2017-04-21)
====================

- Registrations with 100+ nodes fail with content_length_mismatch error
Expand Down
11 changes: 4 additions & 7 deletions scripts/send_specific_registration_data_to_share.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,18 @@
import logging
import sys
import django
from django.db import transaction
django.setup()

from osf.models import AbstractNode
from scripts import utils as script_utils
from website import settings
from website.app import init_app
from website.app import setup_django
from website.project.tasks import on_registration_updated


logger = logging.getLogger(__name__)

def migrate(registrations):
print registrations
assert settings.SHARE_URL, 'SHARE_URL must be set to migrate.'
assert settings.SHARE_API_TOKEN, 'SHARE_API_TOKEN must be set to migrate.'
registrations_count = len(registrations)
Expand All @@ -43,13 +41,12 @@ def main():
'--targets',
action='store',
dest='targets',
help='List of targets, of form {"data": ["registration_id", ...]}',
help='List of targets, of form ["registration_id", ...]',
)
pargs = parser.parse_args()
script_utils.add_file_logger(logger, __file__)
init_app(set_backends=True, routes=False)
with transaction.atomic():
migrate(json.loads(pargs.targets)['data'])
setup_django()
migrate(json.loads(pargs.targets))

if __name__ == "__main__":
main()

0 comments on commit ae68cc1

Please sign in to comment.