Skip to content

Commit b884915

Browse files
committed
Permit sending unauthenticated requests to Grafana with auth=None
1 parent 888bee1 commit b884915

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

grafana_client/client.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,11 @@ def construct_api_url():
9191
self.url = construct_api_url()
9292

9393
self.s = requests.Session()
94-
if not isinstance(self.auth, tuple):
95-
self.auth = TokenAuth(self.auth)
96-
else:
97-
self.auth = requests.auth.HTTPBasicAuth(*self.auth)
94+
if self.auth is not None:
95+
if not isinstance(self.auth, tuple):
96+
self.auth = TokenAuth(self.auth)
97+
else:
98+
self.auth = requests.auth.HTTPBasicAuth(*self.auth)
9899

99100
def __getattr__(self, item):
100101
def __request_runnner(url, json=None, headers=None):

0 commit comments

Comments
 (0)