diff --git a/api/v1/serializers/config.py b/api/v1/serializers/config.py index 33dbfb90..4c1028b2 100644 --- a/api/v1/serializers/config.py +++ b/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: