Skip to content
Draft
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
3 changes: 2 additions & 1 deletion src/databass/api/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from pathlib import Path
from typing import Optional
from dotenv import load_dotenv
from uuid import uuid4

load_dotenv()
VERSION = getenv("VERSION")
Expand Down Expand Up @@ -241,7 +242,7 @@ def get_image(
def write_image(
entity_id: int, entity_type: str, img_type: str, img_bytes: bytes
) -> str:
file_name = str(entity_id) + img_type
file_name = uuid4() + img_type
file_path = IMG_BASE_PATH + "/" + entity_type + "/" + file_name
with open(file_path, "wb") as img_file:
img_file.write(img_bytes)
Expand Down
Loading