add product serialize to broker - quota statistic by product
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user