Fix admin image urls

remotes/origin/hasaccess
Ivlev Denis 8 years ago
parent cb9561e82d
commit 2e2563c99b
  1. 4
      api/v1/serializers/config.py

@ -41,7 +41,7 @@ class ConfigSerializer(serializers.ModelSerializer):
def get_SCHOOL_LOGO_IMAGE(self, config):
request = self.context.get('request')
http_host = request.META.get('HTTP_HOST')
http_host = request.META.get('HTTP_ORIGIN')
if http_host and config.SCHOOL_LOGO_IMAGE:
domain = urlparse(http_host).path.split(':')[0]
SCHOOL_LOGO_IMAGE_url = 'http://' + domain + config.SCHOOL_LOGO_IMAGE.url
@ -51,7 +51,7 @@ class ConfigSerializer(serializers.ModelSerializer):
def get_MAIN_PAGE_TOP_IMAGE(self, config):
request = self.context.get('request')
http_host = request.META.get('HTTP_HOST')
http_host = request.META.get('HTTP_ORIGIN')
if http_host and config.MAIN_PAGE_TOP_IMAGE:
domain = urlparse(http_host).path.split(':')[0]
MAIN_PAGE_TOP_IMAGE_url = 'http://' + domain + config.MAIN_PAGE_TOP_IMAGE.url

Loading…
Cancel
Save