Commit 5e5b16c4 authored by John Red Medrano's avatar John Red Medrano

fixing pic

parent 7c6d024b
......@@ -96,13 +96,17 @@ class UserManagementRetreiveSerializer(serializers.ModelSerializer):
def get_image(self, user):
request = self.context.get('request')
primayPic = user.user_images.filter(is_primary=True).first()
if primayPic:
path = request.build_absolute_uri(primayPic.image.url)
path = path.replace('http', 'https')
return path
else:
return request.build_absolute_uri('/media/no-user.png')
primayPic = user.user_images.first()
# print(primayPic)
path = request.build_absolute_uri(primayPic.image.url)
path = path.replace('https', 'http')
return path
# if primayPic:
# path = request.build_absolute_uri(primayPic.image.url)
# path = path.replace('http', 'https')
# return path
# else:
# return request.build_absolute_uri('/media/no-user.png')
def get_applications(self, user):
if user.user_type.upper() == enums.UserTypeEnum.USER.value:
......
......@@ -402,8 +402,8 @@ class UserViewSet(viewsets.ModelViewSet):
FileHelper.DeleteFile(path=item.image.path)
FileHelper.DeleteFile(path=eximages.first().image.path)
eximages.first().delete()
# FileHelper.DeleteFile(path=eximages.first().image.path)
# eximages.first().delete()
# self.serializer_class = serializer.UserImageSerializer
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment