Skip to content

Commit

Permalink
fix(exports): Fix xlsx export extension (#20629)
Browse files Browse the repository at this point in the history
  • Loading branch information
webjunkie authored Feb 29, 2024
1 parent 3796fba commit c033a7c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion posthog/models/exported_asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def has_content(self):

@property
def filename(self):
ext = self.export_format.split("/")[1]
ext = self.ExportFormat(self.export_format).name.lower()
filename = "export"

if self.export_context and self.export_context.get("filename"):
Expand Down
1 change: 1 addition & 0 deletions posthog/tasks/exports/test/test_csv_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ def test_csv_exporter_excel(self, mocked_object_storage_write: Any, mocked_uuidt
with self.settings(OBJECT_STORAGE_ENABLED=True, OBJECT_STORAGE_EXPORTS_FOLDER="Test-Exports"):
csv_exporter.export_tabular(exported_asset)

assert exported_asset.filename == "export.xlsx"
assert exported_asset.content_location is None

wb = load_workbook(filename=BytesIO(exported_asset.content))
Expand Down

0 comments on commit c033a7c

Please sign in to comment.