Skip to content

Commit 48c2b91

Browse files
authored
Handle blank signatories in migrate_edx_data (#3125)
1 parent e8e4577 commit 48c2b91

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

courses/management/commands/migrate_edx_data.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,18 @@ def _migrate_course_runs(self, conn, options):
193193
continue
194194

195195
signatories = self._get_signatories(
196-
row.get("signatory_names", []), use_default_signatory
196+
row.get("signatory_names") or [], use_default_signatory
197197
)
198198

199+
if not signatories and row.get("mitxonline_course_id") is None:
200+
self.stdout.write(
201+
self.style.ERROR(
202+
f"No valid signatories found with names {row.get('signatory_names')} for course "
203+
f"{row.get('course_readable_id')}, skipping it."
204+
)
205+
)
206+
continue
207+
199208
(course, course_created) = self._create_course(row)
200209

201210
if course_created:

0 commit comments

Comments
 (0)