fix: Charge price was tried to be set for unfinished chargings on application restart

This made rendering the webview fail
This commit is contained in:
Peter Oettig
2025-10-01 17:38:23 +02:00
committed by Florian BEZANNIER
parent 9430b7c857
commit c50e084bd0
+2 -1
View File
@@ -356,7 +356,8 @@ class Database:
@staticmethod
def get_all_charge_without_price(conn) -> List[Charge]:
res = conn.execute("SELECT * FROM battery WHERE price IS NULL").fetchall()
# Chargings that did not end yet can't have a price
res = conn.execute("SELECT * FROM battery WHERE price IS NULL AND stop_at IS NOT NULL").fetchall()
charges = []
for row in res:
charges.append(Charge(**dict_key_to_lower_case(**row)))