From a8dd7f9347204f2a47987765dcdf64ec577ef0fc Mon Sep 17 00:00:00 2001 From: dormantman Date: Tue, 21 Jan 2020 13:07:56 +0300 Subject: [PATCH] Added valid link to unsubscribe --- apps/notification/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/notification/models.py b/apps/notification/models.py index 9ddd955d..4c221280 100644 --- a/apps/notification/models.py +++ b/apps/notification/models.py @@ -148,10 +148,11 @@ class Subscriber(ProjectBaseMixin): def link_to_unsubscribe(self): """Link to unsubscribe.""" schema = settings.SCHEMA_URI - site_domain = settings.SITE_DOMAIN_URI + site_domain = settings.DOMAIN_URI url = settings.SITE_REDIRECT_URL_UNSUBSCRIBE query = f'?code={self.update_code}' - return f'{schema}://{site_domain}{url}{query}' + country_code = '%s.' % self.country_code if self.country_code else '' + return f'{schema}://{country_code}{site_domain}{url}{query}' @property def active_subscriptions(self):