admin img urls

remotes/origin/hasaccess
Ivlev Denis 8 years ago
parent 41d8933220
commit b4aab9f100
  1. 4
      api/v1/serializers/config.py

@ -43,7 +43,7 @@ class ConfigSerializer(serializers.ModelSerializer):
request = self.context.get('request')
http_host = request.META.get('HTTP_ORIGIN')
if http_host and config.SCHOOL_LOGO_IMAGE:
domain = urlparse(http_host).path.split(':')[0]
domain = urlparse(http_host).netloc.split(':')[0]
SCHOOL_LOGO_IMAGE_url = 'http://' + domain + config.SCHOOL_LOGO_IMAGE.url
return SCHOOL_LOGO_IMAGE_url
else:
@ -53,7 +53,7 @@ class ConfigSerializer(serializers.ModelSerializer):
request = self.context.get('request')
http_host = request.META.get('HTTP_ORIGIN')
if http_host and config.MAIN_PAGE_TOP_IMAGE:
domain = urlparse(http_host).path.split(':')[0]
domain = urlparse(http_host).netloc.split(':')[0]
MAIN_PAGE_TOP_IMAGE_url = 'http://' + domain + config.MAIN_PAGE_TOP_IMAGE.url
return MAIN_PAGE_TOP_IMAGE_url
else:

Loading…
Cancel
Save