add login check for first request execution

This commit is contained in:
2025-04-30 15:44:08 +02:00
parent 77b4bd9700
commit e57d39c416
3 changed files with 8 additions and 4 deletions

View File

@@ -66,6 +66,11 @@ def get_sales_prognosis_data(
BuchungsDatum=start_date,
)
empty_response = SalesPrognosisResponse(daten=tuple())
if not session.logged_in:
_, status = session.login()
if status != STATUS_HANDLER.SUCCESS:
return empty_response, status
resp: Response | None = None
try:
for attempt in range(1, (MAX_LOGIN_RETRIES + 1)):