def get_profile_cover_picture(self):
default_cover = None
if self.cover:
return self.cover.url
else:
return default_cover
def get_profile_cover_picture(self, obj):
request = self.context.get('request')
profile_cover_picture_url = obj.get_profile_cover_picture()
return request.build_absolute_uri(profile_cover_picture_url)