Handle some records not having lower_id

This commit is contained in:
Don Mitchell
2014-05-19 13:31:03 -04:00
parent 30f2c9331d
commit 5a62c83d05

View File

@@ -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():