Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions posthog/tasks/exports/image_exporter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import json
import os
import uuid
import tempfile
from datetime import timedelta
from typing import Literal, Optional

Expand Down Expand Up @@ -76,16 +77,14 @@ def _export_to_png(exported_asset: ExportedAsset) -> None:
4. Cleanup: Remove the old file and close the browser session
"""

image_path = None

try:
if not settings.SITE_URL:
raise Exception(
"The SITE_URL is not set. The exporter must have HTTP access to the web app in order to work"
)

image_id = str(uuid.uuid4())
image_path = os.path.join(TMP_DIR, f"{image_id}.png")
tmp = tempfile.TemporaryFile()

if not os.path.exists(TMP_DIR):
os.makedirs(TMP_DIR)
Expand Down