diff --git a/loko/assets/views/trafficlights.py b/loko/assets/views/trafficlights.py index 2cb9d7a..8f7d958 100644 --- a/loko/assets/views/trafficlights.py +++ b/loko/assets/views/trafficlights.py @@ -3706,6 +3706,7 @@ def import_cross_plan(request, intersection_id): intersection = get_object_or_404(TrafficLightIntersection, pk=intersection_id) uploaded_dir = os.path.join(settings.PRIVATE_MEDIA_ROOT, 'cross_plans') + os.makedirs(uploaded_dir, exist_ok=True) # Fetch DXF files and georeferenced documents associated with this intersection dxf_files = [] @@ -4030,6 +4031,7 @@ def import_cross_plan(request, intersection_id): # Save merged results into a temporary JSON file json_filename = f"combined_{intersection.id}_{uuid.uuid4().hex}.json" json_filepath = os.path.join(uploaded_dir, json_filename) + os.makedirs(uploaded_dir, exist_ok=True) with open(json_filepath, 'w', encoding='utf-8') as f: json.dump(merged_deduced, f, indent=4)