changes
This commit is contained in:
@@ -3313,6 +3313,16 @@ def admin_invoices():
|
||||
invoices = list(col.find().sort("created_at", -1))
|
||||
for item in invoices:
|
||||
item["id"] = str(item.get("_id"))
|
||||
|
||||
# Fehlerbehebung: Betrag für das Template in Float umwandeln
|
||||
amt = item.get("amount_eur", 0)
|
||||
if isinstance(amt, str):
|
||||
try:
|
||||
amt = float(amt.replace('.', '').replace(',', '.'))
|
||||
except ValueError:
|
||||
amt = 0.0
|
||||
item["amount_eur"] = amt
|
||||
|
||||
except PyMongoError:
|
||||
flash("Rechnungen konnten nicht geladen werden.", "error")
|
||||
finally:
|
||||
@@ -3326,6 +3336,16 @@ def admin_invoices():
|
||||
instance_requests = list(req_col.find().sort("created_at", -1))
|
||||
for item in instance_requests:
|
||||
item["id"] = str(item.get("_id"))
|
||||
|
||||
# Fehlerbehebung: Betrag auch hier sicher in Float umwandeln
|
||||
amt = item.get("amount_eur", 0)
|
||||
if isinstance(amt, str):
|
||||
try:
|
||||
amt = float(amt.replace('.', '').replace(',', '.'))
|
||||
except ValueError:
|
||||
amt = 0.0
|
||||
item["amount_eur"] = amt
|
||||
|
||||
except PyMongoError:
|
||||
flash("Instanz-Anfragen konnten nicht geladen werden.", "error")
|
||||
finally:
|
||||
|
||||
Reference in New Issue
Block a user