From 818e069b89b66b0af66e29185be07bd783f31ea6 Mon Sep 17 00:00:00 2001 From: Hugo LEVY-FALK Date: Tue, 4 Dec 2018 14:58:28 +0100 Subject: [PATCH] Fixing migrations is more a way of life than a way to have fun. --- ..._20181013_1629.py => 0056_radiusoption.py} | 19 +++++++++++++++++- .../migrations/0057_auto_20181204_0757.py | 20 +++++++++++++++++++ preferences/models.py | 2 +- .../preferences/display_preferences.html | 19 ------------------ 4 files changed, 39 insertions(+), 21 deletions(-) rename preferences/migrations/{0052_auto_20181013_1629.py => 0056_radiusoption.py} (87%) create mode 100644 preferences/migrations/0057_auto_20181204_0757.py diff --git a/preferences/migrations/0052_auto_20181013_1629.py b/preferences/migrations/0056_radiusoption.py similarity index 87% rename from preferences/migrations/0052_auto_20181013_1629.py rename to preferences/migrations/0056_radiusoption.py index 0f1d0b74..e329f598 100644 --- a/preferences/migrations/0052_auto_20181013_1629.py +++ b/preferences/migrations/0056_radiusoption.py @@ -24,7 +24,7 @@ class Migration(migrations.Migration): dependencies = [ ('machines', '0095_auto_20180919_2225'), - ('preferences', '0051_auto_20180919_2225'), + ('preferences', '0055_generaloption_main_site_url'), ] operations = [ @@ -89,6 +89,23 @@ class Migration(migrations.Migration): name='unknown_room', field=models.CharField(choices=[('REJECT', 'Reject the machine'), ('SET_VLAN', 'Place the machine on the VLAN')], default='REJECT', max_length=32, verbose_name='Policy for machine connecting from unregistered room (relevant on ports with STRICT radius mode)'), ), + migrations.AddField( + model_name='radiusoption', + name='vlan_decision_ok', + field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='vlan_ok_option', to='machines.Vlan'), + ), migrations.RunPython(create_radius_policy), + migrations.RemoveField( + model_name='optionaltopologie', + name='radius_general_policy', + ), + migrations.RemoveField( + model_name='optionaltopologie', + name='vlan_decision_nok', + ), + migrations.RemoveField( + model_name='optionaltopologie', + name='vlan_decision_ok', + ), ] diff --git a/preferences/migrations/0057_auto_20181204_0757.py b/preferences/migrations/0057_auto_20181204_0757.py new file mode 100644 index 00000000..ba4e1a6f --- /dev/null +++ b/preferences/migrations/0057_auto_20181204_0757.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.7 on 2018-12-04 13:57 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('preferences', '0056_radiusoption'), + ] + + operations = [ + migrations.AlterField( + model_name='radiusoption', + name='unknown_port', + field=models.CharField(choices=[('REJECT', 'Reject the machine'), ('SET_VLAN', 'Place the machine on the VLAN')], default='REJECT', max_length=32, verbose_name='Policy for unknown port'), + ), + ] diff --git a/preferences/models.py b/preferences/models.py index cbc42516..4e6ebd6b 100644 --- a/preferences/models.py +++ b/preferences/models.py @@ -611,7 +611,7 @@ class RadiusOption(AclMixin, models.Model): max_length=32, choices=CHOICE_POLICY, default=REJECT, - verbose_name=_("Policy for unknown machines"), + verbose_name=_("Policy for unknown port"), ) unknown_port_vlan = models.ForeignKey( 'machines.Vlan', diff --git a/preferences/templates/preferences/display_preferences.html b/preferences/templates/preferences/display_preferences.html index e031b56c..585707a2 100644 --- a/preferences/templates/preferences/display_preferences.html +++ b/preferences/templates/preferences/display_preferences.html @@ -119,25 +119,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,

- - - - - - - - - - - - - - - - - -
{% trans "General policy for VLAN setting" %}{{ topologieoptions.radius_general_policy }}{% trans "This setting defines the VLAN policy after acceptance by RADIUS: either on the IP range's VLAN of the machine, or a VLAN preset in 'VLAN for machines accepted by RADIUS'" %}
{% trans "VLAN for machines accepted by RADIUS" %}{{ topologieoptions.vlan_decision_ok }}{% trans "VLAN for machines rejected by RADIUS" %}{{ topologieoptions.vlan_decision_nok }}
{% trans "VLAN for non members machines" %}{{ topologieoptions.vlan_non_member }}
-
Clef radius
{% can_create RadiusKey%} Ajouter une clef radius