fix(abrechnung): Warnschwelle 0 schaltet die Budget-Warnung aus
Bisher fiel eine 0 durch das or-80-Muster still auf die Voreinstellung zurück, ein Abschalten der Warnung war unmöglich. Jetzt gilt, 0 = aus, NULL = Voreinstellung 80, alles andere wie gehabt. Das Verwaltungsportal bietet die 0 in seinen Formularen an. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Dieser Commit ist enthalten in:
@@ -468,7 +468,12 @@ async def _check_budget_warning(
|
||||
if available <= 0 or lic.get("budget_warning_sent"):
|
||||
return
|
||||
|
||||
threshold = lic.get("budget_warning_percent") or 80
|
||||
# 0 schaltet die Warnung bewusst aus, NULL faellt auf die Voreinstellung 80.
|
||||
threshold = lic.get("budget_warning_percent")
|
||||
if threshold is None:
|
||||
threshold = 80
|
||||
if threshold <= 0:
|
||||
return
|
||||
percent = (used / available) * 100
|
||||
if percent < threshold:
|
||||
return
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren