inventree / inventree-python

Python library for communication with inventree via API
https://docs.inventree.org/en/latest/api/python/python/
MIT License
26 stars 34 forks source link

api.py: self.connected gets set to True independent of server status #171

Closed T0jan closed 1 year ago

T0jan commented 1 year ago

Hi again,

I made as small discovery by accident and wanted to check in if this is the intended behavior: https://github.com/inventree/inventree-python/blob/4073e232f80c4178f168d324d7a24b84bf3e166d/inventree/api.py#L110-L133

line 133 sets self.connected always to True independent of the checks in the class function. This sounds a bit odd and caught me by surprise while doing connection checks in my own code. It's not really a big problem as the connection status can be corrected by calling testSever() after initializing the api but I wanted to check anyway if it is maybe something which slipped through until now.

SchrodingersGat commented 1 year ago

Looks like a bug, it's set previously to "testServer" as you say.