From bdd6d29fd3e04d81d70b69e9c540854c0312dfa0 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 11 Dec 2016 17:24:04 +0100 Subject: [PATCH] Fix pour reversion 2 --- cotisations/views.py | 3 ++- machines/views.py | 4 ++-- topologie/views.py | 3 ++- users/views.py | 3 ++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/cotisations/views.py b/cotisations/views.py index ba3533d6..e0d3c5ea 100644 --- a/cotisations/views.py +++ b/cotisations/views.py @@ -13,6 +13,7 @@ from django.db import transaction from django.forms import modelformset_factory, formset_factory import os from reversion import revisions as reversion +from reversion.models import Version from .models import Facture, Article, Vente, Cotisation, Paiement, Banque from .forms import NewFactureForm, TrezEditFactureForm, EditFactureForm, ArticleForm, DelArticleForm, PaiementForm, DelPaiementForm, BanqueForm, DelBanqueForm, NewFactureFormPdf, SelectArticleForm @@ -399,7 +400,7 @@ def history(request, object, id): else: messages.error(request, "Objet inconnu") return redirect("/cotisations/") - reversions = reversion.get_for_object(object_instance) + reversions = Version.objects.get_for_object(object_instance) paginator = Paginator(reversions, PAGINATION_NUMBER) page = request.GET.get('page') try: diff --git a/machines/views.py b/machines/views.py index eea7fdd3..63c18856 100644 --- a/machines/views.py +++ b/machines/views.py @@ -18,7 +18,7 @@ from django.views.decorators.csrf import csrf_exempt from rest_framework.renderers import JSONRenderer from machines.serializers import InterfaceSerializer, TypeSerializer, AliasSerializer, MxSerializer, ExtensionSerializer, NsSerializer from reversion import revisions as reversion - +from reversion.models import Version import re from .forms import NewMachineForm, EditMachineForm, EditInterfaceForm, AddInterfaceForm, MachineTypeForm, DelMachineTypeForm, ExtensionForm, DelExtensionForm, BaseEditInterfaceForm, BaseEditMachineForm @@ -645,7 +645,7 @@ def history(request, object, id): else: messages.error(request, "Objet inconnu") return redirect("/machines/") - reversions = reversion.get_for_object(object_instance) + reversions = Version.objects.get_for_object(object_instance) paginator = Paginator(reversions, PAGINATION_NUMBER) page = request.GET.get('page') try: diff --git a/topologie/views.py b/topologie/views.py index 6d14cb01..6575b6d6 100644 --- a/topologie/views.py +++ b/topologie/views.py @@ -5,6 +5,7 @@ from django.db import IntegrityError from django.db import transaction from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from reversion import revisions as reversion +from reversion.models import Version from topologie.models import Switch, Port, Room from topologie.forms import EditPortForm, NewSwitchForm, EditSwitchForm, AddPortForm, EditRoomForm @@ -46,7 +47,7 @@ def history(request, object, id): else: messages.error(request, "Objet inconnu") return redirect("/topologie/") - reversions = reversion.get_for_object(object_instance) + reversions = Version.objects.get_for_object(object_instance) paginator = Paginator(reversions, PAGINATION_NUMBER) page = request.GET.get('page') try: diff --git a/users/views.py b/users/views.py index 787eaa35..c82960d2 100644 --- a/users/views.py +++ b/users/views.py @@ -14,6 +14,7 @@ from django.utils import timezone from django.core.urlresolvers import reverse from django.db import transaction +from reversion.models import Version from reversion import revisions as reversion from users.models import User, Right, Ban, Whitelist, School, ListRight, Request from users.models import DelRightForm, BanForm, WhitelistForm, DelSchoolForm, DelListRightForm, NewListRightForm @@ -545,7 +546,7 @@ def history(request, object, id): else: messages.error(request, "Objet inconnu") return redirect("/users/") - reversions = reversion.get_for_object(object_instance) + reversions = Version.objects.get_for_object(object_instance) paginator = Paginator(reversions, PAGINATION_NUMBER) page = request.GET.get('page') try: