1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-11-26 18:37:12 +00:00
This commit is contained in:
Yohann D'ANELLO 2020-03-20 02:20:13 +01:00
parent 3f2b21f7f4
commit 02817c5626
2 changed files with 5 additions and 4 deletions

View File

@ -4,12 +4,13 @@
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from rest_framework.renderers import JSONRenderer from rest_framework.renderers import JSONRenderer
from rest_framework.serializers import ModelSerializer from rest_framework.serializers import ModelSerializer
import getpass
from note.models import NoteUser, Alias from note.models import NoteUser, Alias
from note_kfet.middlewares import get_current_authenticated_user, get_current_ip from note_kfet.middlewares import get_current_authenticated_user, get_current_ip
from .models import Changelog from .models import Changelog
import getpass
# Ces modèles ne nécessitent pas de logs # Ces modèles ne nécessitent pas de logs
EXCLUDED = [ EXCLUDED = [

View File

@ -127,9 +127,9 @@ class ConsoView(LoginRequiredMixin, SingleTableView):
table_pagination = {"per_page": 50} table_pagination = {"per_page": 50}
def get_queryset(self): def get_queryset(self):
return Transaction.objects.filter(PermissionBackend return Transaction.objects.filter(
.filter_queryset(self.request.user, Transaction, "view")) \ PermissionBackend.filter_queryset(self.request.user, Transaction, "view")
.order_by("-id").all()[:50] ).order_by("-id").all()[:50]
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
""" """