8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-09 11:26:27 +00:00
re2o/preferences/migrations/0056_2_radiusoption.py
Hugo Levy-Falk c4a104b3b6 I like my black.
Just ran black on the whoe repository. Fix #210.
2019-11-04 22:47:24 +01:00

35 lines
1,005 B
Python

# -*- 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):
OptionalTopologie = apps.get_model("preferences", "OptionalTopologie")
RadiusOption = apps.get_model("preferences", "RadiusOption")
option, _ = OptionalTopologie.objects.get_or_create()
radius_option = RadiusOption()
radius_option.radius_general_policy = option.radius_general_policy
radius_option.vlan_decision_ok = option.vlan_decision_ok
radius_option.save()
def revert_radius(apps, schema_editor):
pass
class Migration(migrations.Migration):
dependencies = [
("machines", "0095_auto_20180919_2225"),
("preferences", "0055_generaloption_main_site_url"),
("preferences", "0056_1_radiusoption"),
]
operations = [migrations.RunPython(create_radius_policy, revert_radius)]