mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-11-08 15:59:50 +01:00
Add test for oauth2 flow, add temporary ROPB for NoteApp #137
This commit is contained in:
@@ -26,7 +26,7 @@ class PermissionBackend(ModelBackend):
|
||||
|
||||
@staticmethod
|
||||
@memoize
|
||||
def get_raw_permissions(request, t):
|
||||
def get_raw_permissions(request, t): # noqa: C901
|
||||
"""
|
||||
Query permissions of a certain type for a user, then memoize it.
|
||||
:param request: The current request
|
||||
@@ -42,7 +42,7 @@ class PermissionBackend(ModelBackend):
|
||||
if 'mask' in request.GET:
|
||||
try:
|
||||
rank = int(request.GET['mask'])
|
||||
except:
|
||||
except ValueError:
|
||||
rank = 42
|
||||
query &= Q(mask__rank__lte=rank)
|
||||
for scope in request.auth.scope.split(' '):
|
||||
|
||||
Reference in New Issue
Block a user