add product serialize to broker - quota statistic by product

This commit is contained in:
2025-07-08 11:59:58 +03:30
parent bafd1fbbcb
commit 90b090e848
5 changed files with 41 additions and 5 deletions

View File

@@ -1,7 +1,13 @@
import typing
from apps.authorization.models import UserRelations
def detect_file_extension(file_name: str) -> typing.AnyStr:
""" detect extension of a file like: jpg, png, pdf """
extended = file_name.split('.')
return extended[1]
def get_organization_by_user(user: object = None) -> typing.Any:
organization = UserRelations.objects.select_related('organization').get(user=user).organization
return organization