diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2024-05-21 13:12:35 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2024-05-21 13:12:35 +0700 |
| commit | 544e9138e8ec11326ba7ded2e0a29398182fde5b (patch) | |
| tree | 1f8082ae0c2306ad827e4656072402d828e93b50 | |
| parent | b6a0434a4ff9fe580469cf79c30816697e36e48e (diff) | |
fix token
| -rw-r--r-- | indoteknik_custom/models/ged.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/indoteknik_custom/models/ged.py b/indoteknik_custom/models/ged.py index e1881c45..5cf0ab79 100644 --- a/indoteknik_custom/models/ged.py +++ b/indoteknik_custom/models/ged.py @@ -123,17 +123,17 @@ class GedApi(models.Model): return token def get_tracking_awb(self, dunning_run): - current_time = datetime.now() - current_time = current_time.strftime('%Y-%m-%d %H:%M:%S') - query = [('app_id', '=', 1), ('expired_date', '>', current_time)] - token_data = self.env['token.storage'].search(query, order='expired_date desc', limit=1) - if not token_data: - token_data = self._get_token() - token = token_data - else: - token = token_data.access_token + # current_time = datetime.now() + # current_time = current_time.strftime('%Y-%m-%d %H:%M:%S') + # query = [('app_id', '=', 1), ('expired_date', '>', current_time)] + # token_data = self.env['token.storage'].search(query, order='expired_date desc', limit=1) + # if not token_data: + # token_data = self._get_token() + # token = token_data + # else: + # token = token_data.access_token - # token = self.get_token() + token = self.get_token() headers = { 'Content-Type': 'application/json', 'Accept': 'application/json', |
