Skip to content

Commit

Permalink
Merge branch 'rpenido/fal-3610-download-course-tag-spreadsheet' into …
Browse files Browse the repository at this point in the history
…rpenido/fal-3611-download-library-tag-spreadsheet
  • Loading branch information
rpenido committed Feb 10, 2024
2 parents 06810a2 + c82e9cb commit f750076
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1818,7 +1818,7 @@ def test_export_course(self, user_attr) -> None:
assert response.headers['Content-Type'] == 'text/csv'

expected_csv = (
'"Name","Type","ID","Taxonomy 1","Taxonomy 2"\r\n'
'"Name","Type","ID","1-taxonomy-1","2-taxonomy-2"\r\n'
'"Test Course","course","course-v1:orgA+test_course+test_run","Tag 1.1",""\r\n'
'" test sequential","sequential","block-v1:orgA+test_course+test_run+type@sequential+block@test_'
'sequential","Tag 1.1, Tag 1.2","Tag 2.1"\r\n'
Expand Down
3 changes: 1 addition & 2 deletions openedx/core/djangoapps/content_tagging/rest_api/v1/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,7 @@ def _generate_csv_rows() -> Iterator[str]:

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

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

0 comments on commit f750076

Please sign in to comment.