From c3d0ad1deaee3915c9bd0349d8edeff1158ab602 Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Tue, 3 Oct 2017 04:54:08 +0200 Subject: [PATCH 1/3] Un peu de forme affichage ip --- machines/templates/machines/aff_machines.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/machines/templates/machines/aff_machines.html b/machines/templates/machines/aff_machines.html index c22de7c9..db3cdd37 100644 --- a/machines/templates/machines/aff_machines.html +++ b/machines/templates/machines/aff_machines.html @@ -74,9 +74,10 @@ with this program; if not, write to the Free Software Foundation, Inc., {{ interface.type }} {{ interface.mac_address }} - {{ interface.ipv4 }} + IPv4 {{ interface.ipv4 }} {% if ipv6_enabled %} - {{ interface.ipv6 }} +
+ IPv6 {{ interface.ipv6 }} {% endif %} From cda44cdf2a5966a5ff2da12b000e334e1c0474f6 Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Tue, 3 Oct 2017 05:51:14 +0200 Subject: [PATCH 2/3] Renomage, les groupes unix doivent etre unicode --- cotisations/views.py | 22 +++++++++++----------- re2o/settings.py | 4 ++-- users/models.py | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/cotisations/views.py b/cotisations/views.py index 1e64e9e7..0a2a7648 100644 --- a/cotisations/views.py +++ b/cotisations/views.py @@ -109,7 +109,7 @@ def new_facture(request, userid): return form({'factureform': facture_form, 'venteform': article_formset, 'articlelist': article_list}, 'cotisations/new_facture.html', request) @login_required -@permission_required('trésorier') +@permission_required('tresorier') def new_facture_pdf(request): facture_form = NewFactureFormPdf(request.POST or None) if facture_form.is_valid(): @@ -156,7 +156,7 @@ def edit_facture(request, factureid): except Facture.DoesNotExist: messages.error(request, u"Facture inexistante" ) return redirect("/cotisations/") - if request.user.has_perms(['trésorier']): + if request.user.has_perms(['tresorier']): facture_form = TrezEditFactureForm(request.POST or None, instance=facture) elif facture.control or not facture.valid: messages.error(request, "Vous ne pouvez pas editer une facture controlée ou invalidée par le trésorier") @@ -223,7 +223,7 @@ def credit_solde(request, userid): @login_required -@permission_required('trésorier') +@permission_required('tresorier') def add_article(request): article = ArticleForm(request.POST or None) if article.is_valid(): @@ -236,7 +236,7 @@ def add_article(request): return form({'factureform': article}, 'cotisations/facture.html', request) @login_required -@permission_required('trésorier') +@permission_required('tresorier') def edit_article(request, articleid): try: article_instance = Article.objects.get(pk=articleid) @@ -254,7 +254,7 @@ def edit_article(request, articleid): return form({'factureform': article}, 'cotisations/facture.html', request) @login_required -@permission_required('trésorier') +@permission_required('tresorier') def del_article(request): article = DelArticleForm(request.POST or None) if article.is_valid(): @@ -267,7 +267,7 @@ def del_article(request): return form({'factureform': article}, 'cotisations/facture.html', request) @login_required -@permission_required('trésorier') +@permission_required('tresorier') def add_paiement(request): paiement = PaiementForm(request.POST or None) if paiement.is_valid(): @@ -280,7 +280,7 @@ def add_paiement(request): return form({'factureform': paiement}, 'cotisations/facture.html', request) @login_required -@permission_required('trésorier') +@permission_required('tresorier') def edit_paiement(request, paiementid): try: paiement_instance = Paiement.objects.get(pk=paiementid) @@ -298,7 +298,7 @@ def edit_paiement(request, paiementid): return form({'factureform': paiement}, 'cotisations/facture.html', request) @login_required -@permission_required('trésorier') +@permission_required('tresorier') def del_paiement(request): paiement = DelPaiementForm(request.POST or None) if paiement.is_valid(): @@ -329,7 +329,7 @@ def add_banque(request): return form({'factureform': banque}, 'cotisations/facture.html', request) @login_required -@permission_required('trésorier') +@permission_required('tresorier') def edit_banque(request, banqueid): try: banque_instance = Banque.objects.get(pk=banqueid) @@ -347,7 +347,7 @@ def edit_banque(request, banqueid): return form({'factureform': banque}, 'cotisations/facture.html', request) @login_required -@permission_required('trésorier') +@permission_required('tresorier') def del_banque(request): banque = DelBanqueForm(request.POST or None) if banque.is_valid(): @@ -365,7 +365,7 @@ def del_banque(request): return form({'factureform': banque}, 'cotisations/facture.html', request) @login_required -@permission_required('trésorier') +@permission_required('tresorier') def control(request): options, created = GeneralOption.objects.get_or_create() pagination_number = options.pagination_number diff --git a/re2o/settings.py b/re2o/settings.py index c3560eac..c342ef93 100644 --- a/re2o/settings.py +++ b/re2o/settings.py @@ -157,8 +157,8 @@ STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'static_files') RIGHTS_LINK = { - 'cableur' : ['bureau','infra','bofh','trésorier'], - 'bofh' : ['bureau','trésorier'], + 'cableur' : ['bureau','infra','bofh','tresorier'], + 'bofh' : ['bureau','tresorier'], } GRAPH_MODELS = { diff --git a/users/models.py b/users/models.py index 61c39aad..652d2e1d 100644 --- a/users/models.py +++ b/users/models.py @@ -253,7 +253,7 @@ class User(AbstractBaseUser): @cached_property def is_trez(self): - return self.has_right('trésorier') + return self.has_right('tresorier') @cached_property def is_infra(self): From b399502bdae58c4db48815de8466bf8c142e60d9 Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Tue, 3 Oct 2017 05:58:14 +0200 Subject: [PATCH 3/3] Les noms des groupes sont des lettres minuscules --- users/migrations/0055_auto_20171003_0556.py | 21 +++++++++++++++++++++ users/models.py | 3 ++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 users/migrations/0055_auto_20171003_0556.py diff --git a/users/migrations/0055_auto_20171003_0556.py b/users/migrations/0055_auto_20171003_0556.py new file mode 100644 index 00000000..84d901c8 --- /dev/null +++ b/users/migrations/0055_auto_20171003_0556.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.7 on 2017-10-03 03:56 +from __future__ import unicode_literals + +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0054_auto_20170626_2219'), + ] + + operations = [ + migrations.AlterField( + model_name='listright', + name='listright', + field=models.CharField(max_length=255, unique=True, validators=[django.core.validators.RegexValidator('^[a-z]+$', message='Les groupes unix ne peuvent contenir que des lettres minuscules')]), + ), + ] diff --git a/users/models.py b/users/models.py index 652d2e1d..22364a49 100644 --- a/users/models.py +++ b/users/models.py @@ -48,6 +48,7 @@ from django.utils import timezone from django.contrib.auth.models import AbstractBaseUser, BaseUserManager from django.core.validators import MinLengthValidator +from django.core.validators import RegexValidator from topologie.models import Room from cotisations.models import Cotisation, Facture, Paiement, Vente from machines.models import Domain, Interface, MachineType, Machine, Nas, MachineType, Extension, regen @@ -619,7 +620,7 @@ class School(models.Model): class ListRight(models.Model): PRETTY_NAME = "Liste des droits existants" - listright = models.CharField(max_length=255, unique=True) + listright = models.CharField(max_length=255, unique=True, validators=[RegexValidator('^[a-z]+$', message="Les groupes unix ne peuvent contenir que des lettres minuscules")]) gid = models.IntegerField(unique=True, null=True) details = models.CharField(help_text="Description", max_length=255, blank=True)