Skip to content

Commit

Permalink
refactor: set cookies after status code check
Browse files Browse the repository at this point in the history
  • Loading branch information
antwxne committed Jun 28, 2022
1 parent a5830aa commit 7504968
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="CVAT wrapper",
version="0.0.18",
version="1.0.0",
author="antwxne",
author_email="[email protected]",
description="Python wrapper for CVAT API",
Expand Down
4 changes: 1 addition & 3 deletions src/CVAT/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ def __init__(self, username: str = "admin", password: str = "admin", url: str =
}
response: Response = self.session.post(url=f'{self.url}/api/auth/login',
json=body)
self.session.headers = {"Authorization": f'Token {response.json()["key"]}'}
if response.status_code != 200:
raise ValueError("Bad credentials")


self.session.headers = {"Authorization": f'Token {response.json()["key"]}'}

0 comments on commit 7504968

Please sign in to comment.