@@ -36,25 +36,25 @@ class EntitlementsException(Exception):
3636 pass
3737
3838
39- NOT_ENTITLED_RESPONSE : Callable [
40- [Tracker ], JSONResponse
41- ] = lambda tracker = None : JSONResponse (
42- status_code = 403 ,
43- content = {
44- "detail" : (
45- "You have reached your monthly quota limit. Please upgrade your plan to continue."
46- if tracker == Tracker .COUNTERS
47- else (
48- "You have reached your quota limit. Please upgrade your plan to continue."
49- if tracker == Tracker .GAUGES
39+ NOT_ENTITLED_RESPONSE : Callable [[Tracker ], JSONResponse ] = (
40+ lambda tracker = None : JSONResponse (
41+ status_code = 403 ,
42+ content = {
43+ "detail" : (
44+ "You have reached your monthly quota limit. Please upgrade your plan to continue."
45+ if tracker == Tracker .COUNTERS
5046 else (
51- "You do not have access to this feature. Please upgrade your plan to continue."
52- if tracker == Tracker .FLAGS
53- else "You do not have access to this feature."
47+ "You have reached your quota limit. Please upgrade your plan to continue."
48+ if tracker == Tracker .GAUGES
49+ else (
50+ "You do not have access to this feature. Please upgrade your plan to continue."
51+ if tracker == Tracker .FLAGS
52+ else "You do not have access to this feature."
53+ )
5454 )
55- )
56- ) ,
57- },
55+ ),
56+ } ,
57+ )
5858)
5959
6060
@@ -163,7 +163,7 @@ async def check_entitlements(
163163
164164 # TODO: remove this line
165165 log .info (
166- f"adjusting: { organization_id } | { (('0' if (meter .month != 0 and meter .month < 10 ) else '' ) + str (meter .month )) if meter .month != 0 else ' ' } .{ meter .year if meter .year else ' ' } | { 'allow' if check else 'deny ' } | { meter .key } : { meter .value - meter .synced } [{ meter .value } ]"
166+ f"adjusting: { organization_id } | { (('0' if (meter .month != 0 and meter .month < 10 ) else '' ) + str (meter .month )) if meter .month != 0 else ' ' } .{ meter .year if meter .year else ' ' } | { 'allow' if check else 'deny ' } | { meter .key } : { meter .value - meter .synced } [{ meter .value } ]"
167167 )
168168
169169 return check is True , meter , _
0 commit comments