Skip to content

Commit

Permalink
Wrap get_root_folder_id body in try/except block
Browse files Browse the repository at this point in the history
This is done to avoid weird states during the first startup where this may be accessed before the root folder actually exists
  • Loading branch information
nas-tabchiche committed Sep 12, 2024
1 parent 516cea3 commit 68ef4f0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backend/iam/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand Down

0 comments on commit 68ef4f0

Please sign in to comment.