From 5a62c83d055d411fabfdf47e50ed6cae4ea4fffb Mon Sep 17 00:00:00 2001 From: Don Mitchell Date: Mon, 19 May 2014 13:31:03 -0400 Subject: [PATCH] Handle some records not having lower_id --- common/djangoapps/student/migrations/0035_access_roles.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/djangoapps/student/migrations/0035_access_roles.py b/common/djangoapps/student/migrations/0035_access_roles.py index 4c96d58f0c..ca85f90ed5 100644 --- a/common/djangoapps/student/migrations/0035_access_roles.py +++ b/common/djangoapps/student/migrations/0035_access_roles.py @@ -75,7 +75,10 @@ class Migration(DataMigration): hold.setdefault(course_id_string, []).append(group) else: correct_course_key = SlashSeparatedCourseKey(*entry['_id'].values()) - _migrate_users(correct_course_key, role, entry['lower_id']['org']) + if 'lower_id' in entry: + _migrate_users(correct_course_key, role, entry['lower_id']['org']) + else: + _migrate_users(correct_course_key, role, entry['_id']['org'].lower()) # see if any in hold were missed above for held_auth_scope, groups in hold.iteritems():