From 3888969af3aae0ee9cdcc8dadf450456004fbd26 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Fri, 20 Mar 2026 05:45:30 +0000 Subject: [PATCH] [autofix.ci] apply automated fixes --- api/enums/quota_type.py | 14 +++++++++++--- api/services/billing_service.py | 14 +++++++++----- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/api/enums/quota_type.py b/api/enums/quota_type.py index 305f5b9808..4caf9ec98b 100644 --- a/api/enums/quota_type.py +++ b/api/enums/quota_type.py @@ -55,7 +55,10 @@ class QuotaCharge: self._committed = True logger.debug( "Committed %s quota for tenant %s, reservation_id: %s, amount: %d", - self._quota_type.value, self._tenant_id, self.charge_id, amount, + self._quota_type.value, + self._tenant_id, + self.charge_id, + amount, ) except Exception: logger.exception("Failed to commit quota, reservation_id: %s", self.charge_id) @@ -169,13 +172,18 @@ class QuotaType(StrEnum): if not reservation_id: logger.warning( "Reserve returned no reservation_id for %s, feature %s, response: %s", - tenant_id, self.value, reserve_resp, + tenant_id, + self.value, + reserve_resp, ) raise QuotaExceededError(feature=self.value, tenant_id=tenant_id, required=amount) logger.debug( "Reserved %d %s quota for tenant %s, reservation_id: %s", - amount, self.value, tenant_id, reservation_id, + amount, + self.value, + tenant_id, + reservation_id, ) return QuotaCharge( success=True, diff --git a/api/services/billing_service.py b/api/services/billing_service.py index 4648d675c8..2bddd3ab11 100644 --- a/api/services/billing_service.py +++ b/api/services/billing_service.py @@ -95,11 +95,15 @@ class BillingService: Returns: {"available": int, "reserved": int, "released": int} """ - return cls._send_request("POST", "/quota/release", json={ - "tenant_id": tenant_id, - "feature_key": feature_key, - "reservation_id": reservation_id, - }) + return cls._send_request( + "POST", + "/quota/release", + json={ + "tenant_id": tenant_id, + "feature_key": feature_key, + "reservation_id": reservation_id, + }, + ) @classmethod def get_knowledge_rate_limit(cls, tenant_id: str):