Anton Moiseenko 1 жил өмнө
parent
commit
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