mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-07-04 09:32:13 +02:00
More constraints on linting (surely removed in the future)
This commit is contained in:
@ -1,15 +1,13 @@
|
||||
# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
import getpass
|
||||
|
||||
from corres2math.middlewares import get_current_authenticated_user, get_current_ip
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from rest_framework.renderers import JSONRenderer
|
||||
from rest_framework.serializers import ModelSerializer
|
||||
from corres2math.middlewares import get_current_authenticated_user, get_current_ip
|
||||
|
||||
from .models import Changelog
|
||||
|
||||
import getpass
|
||||
|
||||
|
||||
# Ces modèles ne nécessitent pas de logs
|
||||
EXCLUDED = [
|
||||
@ -59,11 +57,11 @@ def save_object(sender, instance, **kwargs):
|
||||
if User.objects.filter(username=username).exists():
|
||||
user = User.objects.get(username=username)
|
||||
|
||||
# On n'enregistre pas les connexions
|
||||
# noinspection PyProtectedMember
|
||||
if user is not None and instance._meta.label_lower == "auth.user" and previous:
|
||||
# On n'enregistre pas les connexions
|
||||
if instance.last_login != previous.last_login:
|
||||
return
|
||||
if user is not None and instance._meta.label_lower == "auth.user" and previous \
|
||||
and instance.last_login != previous.last_login:
|
||||
return
|
||||
|
||||
changed_fields = '__all__'
|
||||
if previous:
|
||||
|
Reference in New Issue
Block a user