Skip to content

Commit 2d8bad0

Browse files
Fix b2b management commands (#3113)
1 parent e0eb7a0 commit 2d8bad0

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

b2b/management/commands/b2b_courseware.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def handle_add(self, contract, coursewares, **kwargs): # noqa: PLR0915, C901
143143

144144
create_runs = kwargs.pop("create_runs")
145145
force_associate = kwargs.pop("force")
146-
can_import = kwargs.pop("import")
146+
can_import = kwargs.pop("can_import")
147147

148148
managed = skipped = 0
149149

@@ -171,6 +171,7 @@ def handle_add(self, contract, coursewares, **kwargs): # noqa: PLR0915, C901
171171
course_run_id=importable_id,
172172
departments=can_import.split(sep=","),
173173
create_cms_page=True,
174+
create_depts=True,
174175
)
175176

176177
if not imported_run:

b2b/management/commands/b2b_list.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,9 @@ def handle_list_courseware(self, *args, **kwargs): # noqa: ARG002
293293
if contract_id:
294294
contract_page_qs = contract_page_qs.filter(id=contract_id)
295295

296-
contracts = contract_page_qs.prefetch_related("programs", "course_runs").all()
296+
contracts = contract_page_qs.prefetch_related(
297+
"contract_programs__program", "course_runs"
298+
).all()
297299

298300
courseware_table = Table(title="Courseware")
299301
courseware_table.add_column("ID", justify="right")

0 commit comments

Comments
 (0)