From 48030d9a53ea3aec18a3a04f763f8970d05efa54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Kervella?= Date: Sun, 15 Apr 2018 18:51:04 +0000 Subject: [PATCH 1/3] Let use HTML tags in asso description --- preferences/templates/preferences/display_preferences.html | 2 +- re2o/templates/re2o/about.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/preferences/templates/preferences/display_preferences.html b/preferences/templates/preferences/display_preferences.html index 4b234c5c..11017161 100644 --- a/preferences/templates/preferences/display_preferences.html +++ b/preferences/templates/preferences/display_preferences.html @@ -190,7 +190,7 @@ with this program; if not, write to the Free Software Foundation, Inc., Description de l'association - {{ assooptions.description }} + {{ assooptions.description | safe }} diff --git a/re2o/templates/re2o/about.html b/re2o/templates/re2o/about.html index ac101031..8e88f5bb 100644 --- a/re2o/templates/re2o/about.html +++ b/re2o/templates/re2o/about.html @@ -30,7 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% block content %}

{% blocktrans %}About {{AssoName}}{% endblocktrans %}

- {{ description }} + {{ description | safe }}

{% trans "About Re2o" %}

{% blocktrans %} From c1e3d34b84ac5e61cd6fc0b915e9000955eee652 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Kervella?= Date: Sun, 15 Apr 2018 23:52:24 +0000 Subject: [PATCH 2/3] Fix : migration for renaming permission Srv.view_soa to Srv.view_srv --- .../migrations/0079_auto_20180416_0107.py | 36 +++++++++++++++++++ machines/models.py | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 machines/migrations/0079_auto_20180416_0107.py diff --git a/machines/migrations/0079_auto_20180416_0107.py b/machines/migrations/0079_auto_20180416_0107.py new file mode 100644 index 00000000..df73f74b --- /dev/null +++ b/machines/migrations/0079_auto_20180416_0107.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.7 on 2018-04-15 23:07 +from __future__ import unicode_literals + +from django.db import migrations + +def rename_permission_soa_to_srv(apps, schema_editor): + Permission = apps.get_model('auth', 'Permission') + # The Permission called 'view_soa' but in the Srv object + try: + to_rename = Permission.objects.get( + codename='view_soa', + content_type__model='srv' + ) + except Permission.DoesNotExist: + # The permission is missing so no problem + pass + else: + to_rename.name = 'Peut voir un object srv' + to_rename.codename = 'view_srv' + to_rename.save() + + +class Migration(migrations.Migration): + + dependencies = [ + ('machines', '0078_auto_20180415_1252'), + ] + + operations = [ + migrations.RunPython(rename_permission_soa_to_srv), + migrations.AlterModelOptions( + name='srv', + options={'permissions': (('view_srv', 'Peut voir un objet srv'),)}, + ), + ] diff --git a/machines/models.py b/machines/models.py index 4282d1f5..9ed973f2 100644 --- a/machines/models.py +++ b/machines/models.py @@ -698,7 +698,7 @@ class Srv(RevMixin, AclMixin, models.Model): class Meta: permissions = ( - ("view_soa", "Peut voir un objet soa"), + ("view_srv", "Peut voir un objet srv"), ) def __str__(self): From 2839a0ce19ece235dffb98d1311ca2c90705681a Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Mon, 16 Apr 2018 05:51:25 +0200 Subject: [PATCH 3/3] Fix #102 --- .../migrations/0059_auto_20180415_2249.py | 36 +++++++++++++++++++ topologie/models.py | 16 ++++++--- 2 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 topologie/migrations/0059_auto_20180415_2249.py diff --git a/topologie/migrations/0059_auto_20180415_2249.py b/topologie/migrations/0059_auto_20180415_2249.py new file mode 100644 index 00000000..a58b710d --- /dev/null +++ b/topologie/migrations/0059_auto_20180415_2249.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.7 on 2018-04-16 03:49 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('topologie', '0058_remove_switch_location'), + ] + + operations = [ + migrations.AlterField( + model_name='switch', + name='model', + field=models.ForeignKey(blank=True, help_text='Modèle du switch', null=True, on_delete=django.db.models.deletion.SET_NULL, to='topologie.ModelSwitch'), + ), + migrations.AlterField( + model_name='switch', + name='number', + field=models.PositiveIntegerField(help_text='Nombre de ports'), + ), + migrations.AlterField( + model_name='switch', + name='stack_member_id', + field=models.PositiveIntegerField(blank=True, help_text='Baie de brassage du switch', null=True), + ), + migrations.AlterField( + model_name='switch', + name='switchbay', + field=models.ForeignKey(blank=True, help_text='Baie de brassage du switch', null=True, on_delete=django.db.models.deletion.SET_NULL, to='topologie.SwitchBay'), + ), + ] diff --git a/topologie/models.py b/topologie/models.py index d8ff2d71..23b72b75 100644 --- a/topologie/models.py +++ b/topologie/models.py @@ -121,25 +121,33 @@ class Switch(AclMixin, Machine): id_max de la stack parente""" PRETTY_NAME = "Switch / Commutateur" - number = models.PositiveIntegerField() + number = models.PositiveIntegerField( + help_text="Nombre de ports" + ) stack = models.ForeignKey( 'topologie.Stack', blank=True, null=True, on_delete=models.SET_NULL ) - stack_member_id = models.PositiveIntegerField(blank=True, null=True) + stack_member_id = models.PositiveIntegerField( + blank=True, + null=True, + help_text="Baie de brassage du switch" + ) model = models.ForeignKey( 'topologie.ModelSwitch', blank=True, null=True, - on_delete=models.SET_NULL + on_delete=models.SET_NULL, + help_text="Modèle du switch" ) switchbay = models.ForeignKey( 'topologie.SwitchBay', blank=True, null=True, - on_delete=models.SET_NULL + on_delete=models.SET_NULL, + help_text="Baie de brassage du switch" ) class Meta: