user_profile may be emtpy on post

This commit is contained in:
Holger Sielaff
2025-09-25 08:51:14 +02:00
parent 8097893eee
commit d1abb0d1f5

View File

@@ -1,4 +1,5 @@
import json import json
import logging
import threading import threading
from django.contrib import messages from django.contrib import messages
@@ -358,7 +359,11 @@ def delete_container(request, container_id):
@csrf_exempt @csrf_exempt
def create_container(request): def create_container(request):
user_profile = request.user.profile try:
user_profile = request.user.profile
except AttributeError as e:
logging.error(f"{e}")
user_profile = None
if request.method == 'POST': if request.method == 'POST':
# Get task_uuid from form # Get task_uuid from form