Skip to content

Commit

Permalink
check if departments have been defined (#2057)
Browse files Browse the repository at this point in the history
  • Loading branch information
collinpreston authored Jan 16, 2024
1 parent cddb650 commit 5368b16
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions courses/management/commands/create_courseware.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def handle(self, *args, **kwargs): # pylint: disable=unused-argument
live=kwargs["live"],
)

if add_depts:
if "add_depts" in locals():
new_program.departments.add(*add_depts)
new_program.save()

Expand Down Expand Up @@ -285,7 +285,7 @@ def handle(self, *args, **kwargs): # pylint: disable=unused-argument
live=kwargs["live"],
)

if add_depts:
if "add_depts" in locals():
new_course.departments.add(*add_depts)
new_course.save()

Expand Down

0 comments on commit 5368b16

Please sign in to comment.