浏览代码

AuthAPI utility hotfix #2

Anton Moiseenko 1 年之前
父节点
当前提交
4b0880a4f2
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      core/utils/AuthAPI.py

+ 2 - 1
core/utils/AuthAPI.py

@@ -13,7 +13,7 @@ class AuthAPI:
         self._login = login
         self._password = password
         self._token = None
-        self._headers =  {'Authorization': f'Token {self._token}'}
+        self._headers =  None
 
     def _create_token(self):
         try:
@@ -40,4 +40,5 @@ class AuthAPI:
     def headers(self):
         if self._token is None:
             self._create_token()
+            self._headers =  {'Authorization': f'Token {self._token}'}
         return self._headers