Features: 1) Add support for loading redirect_uri from dynamic config using constance.BASE_DOMAIN;
Fixes: 1) Add missing imports for `constance.config` and `django.conf.settings`; Extra: 1) Minor adjustment to `payload` initialization for consistency.
This commit is contained in:
parent
f2456d1391
commit
d1ee8d6f97
1 changed files with 3 additions and 0 deletions
|
|
@ -3,6 +3,8 @@ import traceback
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
from constance import config
|
||||||
|
from django.conf import settings
|
||||||
from django.core.cache import cache
|
from django.core.cache import cache
|
||||||
from django.db import transaction
|
from django.db import transaction
|
||||||
|
|
||||||
|
|
@ -52,6 +54,7 @@ class AmoCRM:
|
||||||
payload = {
|
payload = {
|
||||||
"client_id": self.client_id,
|
"client_id": self.client_id,
|
||||||
"client_secret": self.client_secret,
|
"client_secret": self.client_secret,
|
||||||
|
"redirect_uri": f"https://api.{config.BASE_DOMAIN}/",
|
||||||
}
|
}
|
||||||
if self.refresh_token:
|
if self.refresh_token:
|
||||||
payload["grant_type"] = "refresh_token"
|
payload["grant_type"] = "refresh_token"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue