This commit is contained in:
Administrator
2023-09-23 16:13:11 +03:00
commit 9e7fc7b4c1
605 changed files with 78660 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
from django.http import HttpResponse
from BaseLib.BaseView import BaseView
from BaseLib.minio import minio_client
class ProfilePhoto(BaseView):
required_login = True
endpoint = "profile_photo"
def get(self):
profile_photo_bytes = minio_client.get_object(f"profile_photos/{self.request.GET['id']}")
if profile_photo_bytes == b"":
profile_photo_bytes = open("content/empty_profile_photo.jpg", "rb").read()
return HttpResponse(
profile_photo_bytes, content_type="image/jpg"
)