Fixed Getting Systems Bug

Fixed #22
This commit is contained in:
athuler committed 2024-09-10 21:26:48 +02:00
1 parent 49dc2e7aeb
commit e32e174d7c
2 files changed
+23 -22

No files matched your search

+22 -21
View File
@@ -429,27 +429,28 @@ def getSystems(
for parameter in system.keys():
if system[parameter] == '':
system[parameter] = None
try:
allSystems.append(TransportationSystem(
id = int(system["id"]),
name = system["fullname"],
username = system["username"],
goAgencyName = system["goAgencyName"],
email = system["email"],
goTestMode = bool(int(system["goTestMode"])),
name2 = bool(int(system["name2"])),
homepage = system["homepage"],
logo = bool(int(system["logo"])),
goRoutePlannerEnabled = bool(int(system["goRoutePlannerEnabled"])),
goColor = system["goColor"],
goSupportEmail = system["goSupportEmail"],
goSharedCode = toIntInclNone(system["goSharedCode"]),
goAuthenticationType = bool(int(system["goAuthenticationType"])),
))
except Exception as e:
print(e)
print(system)
return()
# Check all keys exist
for key in ["goAgencyName", "email", "email", "goTestMode", "name2", "homepage", "logo", "goRoutePlannerEnabled", "goColor", "goSupportEmail", "goSharedCode", "goAuthenticationType"]:
if key not in system.keys():
system[key] = None
allSystems.append(TransportationSystem(
id = int(system["id"]),
name = system["fullname"],
username = system["username"],
goAgencyName = system["goAgencyName"],
email = system["email"],
goTestMode = bool(int(system["goTestMode"])),
name2 = bool(int(system["name2"])),
homepage = system["homepage"],
logo = bool(int(system["logo"])),
goRoutePlannerEnabled = bool(int(system["goRoutePlannerEnabled"])),
goColor = system["goColor"],
goSupportEmail = system["goSupportEmail"],
goSharedCode = toIntInclNone(system["goSharedCode"]),
goAuthenticationType = bool(int(system["goAuthenticationType"])),
))
return(allSystems)
+1 -1
View File
@@ -8,7 +8,7 @@ with open("requirements.txt", "r") as fh:
setup(
name='PassioGo',
version="0.2.1",
version="0.2.2",
description="An unofficial API for Passio Go",
long_description=long_description,
long_description_content_type='text/markdown',