From 68ef4f079017da0eb7ad0f1a3ecf65d7b025cdc3 Mon Sep 17 00:00:00 2001 From: Nassim Tabchiche Date: Thu, 12 Sep 2024 18:06:29 +0200 Subject: [PATCH] Wrap get_root_folder_id body in try/except block This is done to avoid weird states during the first startup where this may be accessed before the root folder actually exists --- backend/iam/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/iam/models.py b/backend/iam/models.py index dc2167139..ef770e718 100644 --- a/backend/iam/models.py +++ b/backend/iam/models.py @@ -64,7 +64,10 @@ def get_root_folder() -> Self: @staticmethod def get_root_folder_id() -> uuid.UUID: """class function for general use""" - return Folder.get_root_folder().id + try: + return uuid.UUID(_get_root_folder().id) + except: + return _get_root_folder() class ContentType(models.TextChoices): """content type for a folder"""