aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBobby <[email protected]>2022-08-02 01:16:19 +0530
committerBobby <[email protected]>2022-08-02 01:16:19 +0530
commit0a9bac74cdad24123cf67791ebecb482476a119e (patch)
treeaeb8184fbb61136b0ca487627af360e0a5585ed6
parent6e4a5984db8311a15dc31a22b21ded01eec278de (diff)
downloadthatcomputerscientist-0a9bac74cdad24123cf67791ebecb482476a119e.tar.xz
thatcomputerscientist-0a9bac74cdad24123cf67791ebecb482476a119e.zip
Moved urlparsing to request.scheme while sending user url
-rw-r--r--blog/views.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/blog/views.py b/blog/views.py
index afbf0110..7cff365e 100644
--- a/blog/views.py
+++ b/blog/views.py
@@ -16,7 +16,8 @@ def account(request):
avatar = hashlib.md5(str(user_profile.gravatar_email).lower().encode('utf-8')).hexdigest() if user_profile.gravatar_email else hashlib.md5(str(user.email).lower().encode()).hexdigest()
user_subdomain_url = None
if user_profile.is_public:
- scheme = request.scheme if request.scheme else 'http'
+ print(request.scheme)
+ scheme = request[':scheme'] or request.scheme or 'http'
domain = urlparse(request.build_absolute_uri()).netloc
user_subdomain_url = '{}://{}.{}'.format(scheme, user.username, domain)
except UserProfile.DoesNotExist: