Browse Source

Cria migração para aplicar valores válidos e únicos (#2813)

Fixes #2807
pull/2824/head
Vinícius Cantuária 6 years ago
committed by Cesar Carvalho
parent
commit
7c8b34beb1
  1. 23
      sapl/sessao/migrations/0040_auto_20190523_1130.py

23
sapl/sessao/migrations/0040_auto_20190523_1130.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-23 14:30
from __future__ import unicode_literals
from django.db import migrations
def unifica_opcaoes_ordenacao_resumo(apps, schema_editor):
ResumoOrdenacao = apps.get_model('sessao', 'ResumoOrdenacao')
ro = ResumoOrdenacao.objects.get_or_create()[0]
if 'oradores_o_d' not in ro.__dict__:
ro.decimo_quarto = 'oradores_o_d'
ro.save()
class Migration(migrations.Migration):
dependencies = [
('sessao', '0039_auto_20190430_0825'),
]
operations = [
migrations.RunPython(unifica_opcaoes_ordenacao_resumo)
]
Loading…
Cancel
Save