Skip to content

Commit 6046069

Browse files
committed
style: format scope cleanup
1 parent 98f29c8 commit 6046069

2 files changed

Lines changed: 5 additions & 16 deletions

File tree

server/polar/auth/dependencies.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,12 +224,8 @@ async def __call__(
224224
AuthSubject[Anonymous | User], Depends(_WebUserOrAnonymous)
225225
]
226226

227-
_WebUserRead = Authenticator(
228-
allowed_subjects={User}, required_scopes=None
229-
)
227+
_WebUserRead = Authenticator(allowed_subjects={User}, required_scopes=None)
230228
WebUserRead = Annotated[AuthSubject[User], Depends(_WebUserRead)]
231229

232-
_WebUserWrite = Authenticator(
233-
allowed_subjects={User}, required_scopes=None
234-
)
230+
_WebUserWrite = Authenticator(allowed_subjects={User}, required_scopes=None)
235231
WebUserWrite = Annotated[AuthSubject[User], Depends(_WebUserWrite)]

server/polar/search/service.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,24 +39,17 @@ def _try_parse_uuid(self, query: str) -> uuid.UUID | None:
3939
return None
4040

4141
def _has_products_scope(self, auth_subject: AuthSubject[User]) -> bool:
42-
return bool(
43-
auth_subject.scopes
44-
& {Scope.products_read, Scope.products_write}
45-
)
42+
return bool(auth_subject.scopes & {Scope.products_read, Scope.products_write})
4643

4744
def _has_customers_scope(self, auth_subject: AuthSubject[User]) -> bool:
48-
return bool(
49-
auth_subject.scopes
50-
& {Scope.customers_read, Scope.customers_write}
51-
)
45+
return bool(auth_subject.scopes & {Scope.customers_read, Scope.customers_write})
5246

5347
def _has_orders_scope(self, auth_subject: AuthSubject[User]) -> bool:
5448
return bool(auth_subject.scopes & {Scope.orders_read, Scope.orders_write})
5549

5650
def _has_subscriptions_scope(self, auth_subject: AuthSubject[User]) -> bool:
5751
return bool(
58-
auth_subject.scopes
59-
& {Scope.subscriptions_read, Scope.subscriptions_write}
52+
auth_subject.scopes & {Scope.subscriptions_read, Scope.subscriptions_write}
6053
)
6154

6255
async def search(

0 commit comments

Comments
 (0)