Skip to content

Commit b559803

Browse files
committed
Adding Last Conditional
1 parent 6bf47a3 commit b559803

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

backend/courses/management/commands/loadstatus.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ def set_all_status(semester=None, add_status_update=False, verbose=False):
6464
)
6565
status_updates_out_of_sync.append(section_code)
6666

67-
Section.objects.bulk_update(sections_to_update, ["status"])
67+
if sections_to_update:
68+
Section.objects.bulk_update(sections_to_update, ["status"])
6869

6970
if verbose:
7071
print(f"{len(statuses_out_of_sync)} statuses were out of sync.")

0 commit comments

Comments
 (0)