mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-07-29 05:39:56 +00:00
small improvements on code smell
* fix some grammar/typo errors * change some statements to be more clear * use pattern matching for enum processing
This commit is contained in:
@ -102,6 +102,7 @@ def _auth_handler(allow_read_only: bool) -> MiddlewareType:
|
||||
permission = UserAccess.Unauthorized if isinstance(handler_instance, StaticResource) else UserAccess.Full
|
||||
else:
|
||||
permission = UserAccess.Full
|
||||
|
||||
if permission == UserAccess.Unauthorized: # explicit if elif else for better code coverage
|
||||
pass
|
||||
elif allow_read_only and UserAccess.Read.permits(permission):
|
||||
|
@ -107,7 +107,7 @@ class BaseView(View, CorsViewMixin):
|
||||
get non-empty value from request parameters
|
||||
|
||||
Args:
|
||||
extractor(Callable[[str], T | None]): function to get value by the specified key
|
||||
extractor(Callable[[str], T | None]): function to get value
|
||||
key(str): key to extract value
|
||||
|
||||
Returns:
|
||||
|
Reference in New Issue
Block a user