diff --git a/l10n_ro_account_anaf_sync/controllers/anaf_oauth.py b/l10n_ro_account_anaf_sync/controllers/anaf_oauth.py index d5832225a..26975c45b 100644 --- a/l10n_ro_account_anaf_sync/controllers/anaf_oauth.py +++ b/l10n_ro_account_anaf_sync/controllers/anaf_oauth.py @@ -56,11 +56,10 @@ def redirect_anaf(self, anaf_config_id, **kw): "last_request_datetime": now, } ) - anaf_oauth_url = anaf_config.anaf_oauth_url client_id = anaf_config.client_id odoo_oauth_url = user.get_base_url() + "/l10n_ro_account_anaf_sync/anaf_oauth" redirect_url = "%s?response_type=code&client_id=%s&redirect_uri=%s" % ( - anaf_oauth_url, + anaf_config.anaf_oauth_url + "/authorize", client_id, odoo_oauth_url, ) @@ -122,18 +121,12 @@ def get_anaf_oauth_code(self, **kw): redirect_uri = user.get_base_url() + "/l10n_ro_account_anaf_sync/anaf_oauth" data = { "grant_type": "authorization_code", - "client_id": "%s", - "client_secret": "%s", - "code": "%s", - "access_key": "%s", - "redirect_uri": "%s", - } % ( - anaf_config.client_id, - anaf_config.client_secret, - code, - code, - redirect_uri, - ) + "client_id": "{}".format(anaf_config.client_id), + "client_secret": "{}".format(anaf_config.client_secret), + "code": "{}".format(code), + "access_key": "{}".format(code), + "redirect_uri": "{}".format(redirect_uri), + } response = requests.post( anaf_config.anaf_oauth_url + "/token", data=data,