Commit ef943f17 authored by John Red Medrano's avatar John Red Medrano

Merge pull request #609 in RMS/api-main-service from red-develop to RMSv2

* commit '66873da6':
  add replace on absolute url and manually set the http to https
parents f18c4e60 66873da6
......@@ -80,17 +80,9 @@ class UserManagementRetreiveSerializer(serializers.ModelSerializer):
primayPic = user.user_images.filter(is_primary=True).first()
if primayPic:
# print(request.build_absolute_uri(primayPic.image.url))
# print(request)
# return request.build_absolute_uri(primayPic.image.url)
print(
os.path.join(settings.MEDIA_ROOT)
)
print(
os.path.join(settings.MEDIA_ROOT, f'user_images/{primayPic.image.url}')
)
return request.build_absolute_uri(primayPic.image.url)
# return request.build_absolute_uri('/media/no-user.png')
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')
......
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