Skip to content

Commit ae68cc1

Browse files
committed
Minor script updates; update release date
1 parent 1e9159c commit ae68cc1

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

CHANGELOG

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Changelog
33
*********
44

5-
0.106.0 (2017-04-20)
5+
0.106.0 (2017-04-21)
66
====================
77

88
- Registrations with 100+ nodes fail with content_length_mismatch error

scripts/send_specific_registration_data_to_share.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,18 @@
44
import logging
55
import sys
66
import django
7-
from django.db import transaction
87
django.setup()
98

109
from osf.models import AbstractNode
1110
from scripts import utils as script_utils
1211
from website import settings
13-
from website.app import init_app
12+
from website.app import setup_django
1413
from website.project.tasks import on_registration_updated
1514

1615

1716
logger = logging.getLogger(__name__)
1817

1918
def migrate(registrations):
20-
print registrations
2119
assert settings.SHARE_URL, 'SHARE_URL must be set to migrate.'
2220
assert settings.SHARE_API_TOKEN, 'SHARE_API_TOKEN must be set to migrate.'
2321
registrations_count = len(registrations)
@@ -43,13 +41,12 @@ def main():
4341
'--targets',
4442
action='store',
4543
dest='targets',
46-
help='List of targets, of form {"data": ["registration_id", ...]}',
44+
help='List of targets, of form ["registration_id", ...]',
4745
)
4846
pargs = parser.parse_args()
4947
script_utils.add_file_logger(logger, __file__)
50-
init_app(set_backends=True, routes=False)
51-
with transaction.atomic():
52-
migrate(json.loads(pargs.targets)['data'])
48+
setup_django()
49+
migrate(json.loads(pargs.targets))
5350

5451
if __name__ == "__main__":
5552
main()

0 commit comments

Comments
 (0)