diff --git a/topologie/migrations/0024_auto_20170826_1800.py b/topologie/migrations/0024_auto_20170826_1800.py new file mode 100644 index 00000000..ce108929 --- /dev/null +++ b/topologie/migrations/0024_auto_20170826_1800.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.7 on 2017-08-26 16:00 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('topologie', '0023_auto_20170826_1530'), + ] + + operations = [ + migrations.AlterField( + model_name='port', + name='radius', + field=models.CharField(choices=[('NO', 'NO'), ('STRICT', 'STRICT'), ('BLOQ', 'BLOQ'), ('COMMON', 'COMMON')], default='NO', max_length=32), + ), + ] diff --git a/topologie/models.py b/topologie/models.py index e64a9e51..f924f6cd 100644 --- a/topologie/models.py +++ b/topologie/models.py @@ -58,7 +58,10 @@ class Port(models.Model): ('BLOQ', 'BLOQ'), ('COMMON', 'COMMON'), ) - STATES = STATES_BASE + tuple([(str(id), str(id)) for id in list(Vlan.objects.values_list('vlan_id', flat=True).order_by('vlan_id'))]) + try: + STATES = STATES_BASE + tuple([(str(id), str(id)) for id in list(Vlan.objects.values_list('vlan_id', flat=True).order_by('vlan_id'))]) + except: + STATES = STATES_BASE switch = models.ForeignKey('Switch', related_name="ports") port = models.IntegerField()