Skip to content

Commit c82e9cb

Browse files
committed
refactor: use taxonomy.export_id in header
1 parent 5245264 commit c82e9cb

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

openedx/core/djangoapps/content_tagging/rest_api/v1/tests/test_views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1818,7 +1818,7 @@ def test_export_course(self, user_attr) -> None:
18181818
assert response.headers['Content-Type'] == 'text/csv'
18191819

18201820
expected_csv = (
1821-
'"Name","Type","ID","Taxonomy 1","Taxonomy 2"\r\n'
1821+
'"Name","Type","ID","1-taxonomy-1","2-taxonomy-2"\r\n'
18221822
'"Test Course","course","course-v1:orgA+test_course+test_run","Tag 1.1",""\r\n'
18231823
'" test sequential","sequential","block-v1:orgA+test_course+test_run+type@sequential+block@test_'
18241824
'sequential","Tag 1.1, Tag 1.2","Tag 2.1"\r\n'

openedx/core/djangoapps/content_tagging/rest_api/v1/views.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,7 @@ def _generate_csv_rows() -> Iterator[str]:
174174

175175
# Prepare the header for the taxonomies
176176
for taxonomy_id, taxonomy in taxonomies.items():
177-
# ToDo: change to taxonomy.external_id after the external_id is implemented
178-
header[f"taxonomy_{taxonomy_id}"] = taxonomy.name
177+
header[f"taxonomy_{taxonomy_id}"] = taxonomy.export_id
179178

180179
csv_writer = csv.DictWriter(pseudo_buffer, fieldnames=header.keys(), quoting=csv.QUOTE_NONNUMERIC)
181180
yield csv_writer.writerow(header)

0 commit comments

Comments
 (0)