1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-10-18 03:15:10 +02:00

Compare commits

..

2 Commits

Author SHA1 Message Date
quark
7e664c2d4e Merge branch 'pyjacpp-main-patch-28593' into 'translations'
fix: typo CR@ANS -> CR@NS

See merge request bde/nk20!356
2025-10-16 23:33:33 +02:00
PyJaC++
95fa3c1bc9 fix: typo CR@ANS -> CR@NS 2025-10-16 22:33:37 +02:00
3 changed files with 2 additions and 11 deletions

View File

@@ -39,15 +39,7 @@ class PermissionBackend(ModelBackend):
def permission_filter(membership_obj):
query = Q(pk=-1)
if 'mask' in request.GET:
try:
rank = int(request.GET['mask'])
except:
rank = 42
query &= Q(mask__rank__lte=rank)
for scope in request.auth.scope.split(' '):
if scope == "openid":
continue
permission_id, club_id = scope.split('_')
if int(club_id) == membership_obj.club_id:
query |= Q(pk=permission_id)

View File

@@ -10,7 +10,6 @@ from note_kfet.middlewares import get_current_request
from .backends import PermissionBackend
from .models import Permission
from django.utils.translation import gettext_lazy as _
class PermissionScopes(BaseScopes):
"""
@@ -33,7 +32,7 @@ class PermissionScopes(BaseScopes):
scopes = {f"{p.id}_{club.id}": f"{p.description} (club {club.name})"
for p in Permission.objects.all() for club in Club.objects.all()}
scopes['openid'] = _("OpenID Connect (username and email)")
scopes['openid'] = "OpenID Connect"
return scopes
def get_available_scopes(self, application=None, request=None, *args, **kwargs):

View File

@@ -4399,7 +4399,7 @@ msgstr "Géré par le BDE"
#: note_kfet/templates/base.html:231
msgid "Hosted by Cr@ns"
msgstr "Hébergé par le Cr@ans"
msgstr "Hébergé par le Cr@ns"
#: note_kfet/templates/base.html:273
msgid "The note is not available for now"