diff --git a/account_mtd/models/mtd_user_authorisation.py b/account_mtd/models/mtd_user_authorisation.py index 55f4b19..1cbfe94 100644 --- a/account_mtd/models/mtd_user_authorisation.py +++ b/account_mtd/models/mtd_user_authorisation.py @@ -18,7 +18,9 @@ class MtdUserAuthorisation(models.Model): @api.multi def get_user_authorisation(self, module_name=None, record=None): tracker_api = self.create_tracker_record(module_name, record) - redirect_uri = "{}/auth-redirect".format(record.hmrc_configuration.redirect_url) + normalised_redirect_url = \ + record.hmrc_configuration.redirect_url.rstrip('/') + redirect_uri = "{}/auth-redirect".format(normalised_redirect_url) state = "" # State is optional if record.hmrc_configuration.state: @@ -94,4 +96,4 @@ def create_tracker_record(self, module_name=None, record=None): 'module_name': module_name, 'company_id': record.company_id.id }) - return tracker_api \ No newline at end of file + return tracker_api