diff --git a/logs/templates/logs/aff_summary.html b/logs/templates/logs/aff_summary.html
index 57cf56e5..c20bf2cb 100644
--- a/logs/templates/logs/aff_summary.html
+++ b/logs/templates/logs/aff_summary.html
@@ -37,24 +37,24 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% for revision in revisions_list %}
- {% for reversion in revision.version_set.all %}
+ {% for reversion in revision.revision.version_set.all %}
{% if reversion.content_type.name in 'ban,whitelist,user,vente,interface'|slice:',' %}
- {{ revision.date_created }} |
+ {{ revision.datetime }} |
{% if reversion.content_type.name == 'ban' %}
- {{ revision.user.get_username }} a banni {{ reversion.object.user.get_username }} ({{ reversion.object.raison }}) |
+ {{ revision.revision.user.get_username }} a banni {{ reversion.object.user.get_username }} ({{ reversion.object.raison }}) |
{% elif reversion.content_type.name == 'whitelist' %}
- {{ revision.user.get_username }} a autorisé gracieusement {{ reversion.object.user.get_username }} ({{ reversion.object.raison }}) |
+ {{ revision.revision.user.get_username }} a autorisé gracieusement {{ reversion.object.user.get_username }} ({{ reversion.object.raison }}) |
{% elif reversion.content_type.name == 'user' %}
- {{ revision.user.get_username }} a ajouté {{ reversion.object.get_username }} |
+ {{ revision.revision.user.get_username }} a ajouté {{ reversion.object.get_username }} |
{% elif reversion.content_type.name == 'vente' %}
{{ reversion.object.facture.user.get_username }} a acheté {{ reversion.object.number }}x {{ reversion.object.name }}{% if reversion.object.iscotisation %} (+{{ reversion.object.duration }} mois){% endif %} |
{% elif reversion.content_type.name == 'interface' %}
- {{ revision.user.get_username }} a ajouté une interface à {{ reversion.object.machine.user.get_username }} (MAC : {{ reversion.object.mac_bare }}) |
+ {{ revision.revision.user.get_username }} a ajouté une interface à {{ reversion.object.machine.user.get_username }} (MAC : {{ reversion.object.mac_bare }}) |
{% endif %}
{% if is_bureau %}
-
+
Annuler
diff --git a/logs/views.py b/logs/views.py
index 4be87899..be24dcac 100644
--- a/logs/views.py
+++ b/logs/views.py
@@ -69,7 +69,16 @@ def form(ctx, template, request):
def index(request):
options, created = GeneralOption.objects.get_or_create()
pagination_number = options.pagination_number
- revisions = Revision.objects.all().order_by('date_created').reverse().select_related('user').prefetch_related('version_set__object')
+
+ revisions_not_filtered = Revision.objects.all().order_by('date_created').reverse().select_related('user').prefetch_related('version_set__object')
+ revisions = []
+ for revision in revisions_not_filtered :
+ reversions = revision.version_set.all()
+ for reversion in reversions :
+ if reversion.content_type.name in ['ban', 'whitelist', 'vente', 'cotisation', 'interface', 'machine', 'user'] :
+ revisions.append( {'datetime':revision.date_created.strftime('%d/%m/%y %H:%M:%S'), 'revision':revision } )
+ break
+
paginator = Paginator(revisions, pagination_number)
page = request.GET.get('page')
try:
|