From 7a8c962ef4aa39ca7441ad1920ff1afbf538b29e Mon Sep 17 00:00:00 2001 From: rohan-chaturvedi Date: Sun, 8 Oct 2023 17:02:08 +0530 Subject: [PATCH] fix: hostname --- backend/api/emails.py | 2 +- backend/backend/settings.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/api/emails.py b/backend/api/emails.py index f91946dca..961f7acec 100644 --- a/backend/api/emails.py +++ b/backend/api/emails.py @@ -53,7 +53,7 @@ def send_inite_email(invite): invited_by_social_acc = invite.invited_by.user.socialaccount_set.first() invited_by_name = invited_by_social_acc.extra_data.get('name') invite_code = encode_string_to_base64(str(invite.id)) - invite_link = f"{os.getenv('HTTP_PROTOCOL')}{os.getenv('HOST')}/invite/{invite_code}" + invite_link = f"{getattr(settings, 'HOSTNAME')}/invite/{invite_code}" context = { 'organisation': organisation, diff --git a/backend/backend/settings.py b/backend/backend/settings.py index 602334b42..e0a74ee53 100644 --- a/backend/backend/settings.py +++ b/backend/backend/settings.py @@ -55,6 +55,8 @@ SESSION_COOKIE_AGE = 86400 # 24 hours +HOSTNAME = f"{os.getenv('HTTP_PROTOCOL')}{os.getenv('HOST')}" + # Application definition INSTALLED_APPS = [ @@ -267,4 +269,3 @@ APP_HOST = os.getenv('APP_HOST') except: APP_HOST = 'self' - \ No newline at end of file