2018-12-30 09:42:05 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# Generated by Django 1.10.7 on 2018-10-13 14:29
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
from django.db import migrations, models
|
|
|
|
import django.db.models.deletion
|
|
|
|
import re2o.mixins
|
|
|
|
|
|
|
|
|
|
|
|
def create_radius_policy(apps, schema_editor):
|
2019-11-04 16:55:03 +00:00
|
|
|
OptionalTopologie = apps.get_model("preferences", "OptionalTopologie")
|
|
|
|
RadiusOption = apps.get_model("preferences", "RadiusOption")
|
2018-12-30 09:42:05 +00:00
|
|
|
|
2019-11-04 16:55:03 +00:00
|
|
|
option, _ = OptionalTopologie.objects.get_or_create()
|
2018-12-30 09:42:05 +00:00
|
|
|
|
|
|
|
radius_option = RadiusOption()
|
|
|
|
radius_option.radius_general_policy = option.radius_general_policy
|
|
|
|
radius_option.vlan_decision_ok = option.vlan_decision_ok
|
|
|
|
|
|
|
|
radius_option.save()
|
|
|
|
|
2019-11-04 16:55:03 +00:00
|
|
|
|
2018-12-30 13:56:25 +00:00
|
|
|
def revert_radius(apps, schema_editor):
|
|
|
|
pass
|
|
|
|
|
2018-12-30 09:42:05 +00:00
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
dependencies = [
|
2019-11-04 16:55:03 +00:00
|
|
|
("machines", "0095_auto_20180919_2225"),
|
|
|
|
("preferences", "0055_generaloption_main_site_url"),
|
|
|
|
("preferences", "0056_1_radiusoption"),
|
2018-12-30 09:42:05 +00:00
|
|
|
]
|
|
|
|
|
2019-11-04 16:55:03 +00:00
|
|
|
operations = [migrations.RunPython(create_radius_policy, revert_radius)]
|