Skip to content

Commit 2497c03

Browse files
Johannes HötterJohannes Hötter
authored andcommitted
postgres change
1 parent 86f1eac commit 2497c03

File tree

4 files changed

+9
-14
lines changed

4 files changed

+9
-14
lines changed

onetask/__init__.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,13 @@ def __init__(
1313
self, user_name: str, password: str, project_id: str, stage: str = "prod"
1414
):
1515
settings.set_stage(stage)
16-
if stage in ["prod", "test", "dev"]:
17-
self.session_token = api_calls.create_session_token(
18-
user_name=user_name, password=password
19-
)
20-
if self.session_token is not None:
21-
msg.good("Logged in to system.")
22-
else:
23-
msg.fail("Could not log in. Please check your username and password.")
16+
self.session_token = api_calls.create_session_token(
17+
user_name=user_name, password=password
18+
)
19+
if self.session_token is not None:
20+
msg.good("Logged in to system.")
2421
else:
25-
self.session_token = None
26-
msg.info("Sending requests to localhost")
22+
msg.fail("Could not log in. Please check your username and password.")
2723
self.project_id = project_id
2824

2925
def register_custom_lf(self, lf: Callable) -> None:

onetask/api_calls.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ def __init__(
4747
headers = {
4848
"Content-Type": "application/json",
4949
"User-Agent": f"python-sdk-{version}",
50+
"Authorization": f"Bearer {session_token}",
5051
}
51-
if session_token:
52-
headers["Authorization"] = f"Bearer {session_token}"
5352

5453
if data is None:
5554
self.response = requests.request(self.method, url, headers=headers)

onetask/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def get_base_url():
1616
elif STAGE == "dev":
1717
return "https://app.dev.onetask.ai"
1818
else:
19-
return "http://localhost:8000"
19+
return STAGE
2020

2121

2222
def get_authentication_url():

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
setup(
1212
name="onetask",
13-
version="0.1.2",
13+
version="0.1.6",
1414
author="onetask",
1515
author_email="[email protected]",
1616
description="Official Python SDK for the onetask API",

0 commit comments

Comments
 (0)