mirror of
https://github.com/flobz/psa_car_controller.git
synced 2026-08-22 01:16:14 +00:00
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:
committed by
Florian BEZANNIER
parent
9430b7c857
commit
c50e084bd0
@@ -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)))
|
||||
|
||||
Reference in New Issue
Block a user