mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-21 01:48:21 +02:00
Fix linters
This commit is contained in:
@ -2,8 +2,8 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-or-lateré
|
||||
|
||||
from django.contrib import admin
|
||||
|
||||
from note_kfet.admin import admin_site
|
||||
|
||||
from .models import Permission, PermissionMask, Role
|
||||
|
||||
|
||||
|
@ -36,7 +36,7 @@ class PermissionBackend(ModelBackend):
|
||||
return Permission.objects.none()
|
||||
|
||||
memberships = Membership.objects.filter(user=user).all()
|
||||
|
||||
|
||||
perms = []
|
||||
|
||||
for membership in memberships:
|
||||
@ -49,7 +49,6 @@ class PermissionBackend(ModelBackend):
|
||||
perms.append(perm)
|
||||
return perms
|
||||
|
||||
|
||||
@staticmethod
|
||||
def permissions(user, model, type):
|
||||
"""
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
from django.core.exceptions import PermissionDenied
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from note_kfet.middlewares import get_current_authenticated_user
|
||||
@ -51,9 +51,6 @@ def pre_save_object(sender, instance, **kwargs):
|
||||
# In the other case, we check if he/she has the right to change one field
|
||||
previous = qs.get()
|
||||
|
||||
if isinstance(instance, User) and instance.last_login != previous.last_login:
|
||||
pass #return
|
||||
|
||||
for field in instance._meta.fields:
|
||||
field_name = field.name
|
||||
old_value = getattr(previous, field.name)
|
||||
|
Reference in New Issue
Block a user