Browse Source

Merge pull request #1067 from interlegis/1048-status-stub-salvo-errado

fix #1048 - StatusTramitacao migração errada
pull/1070/head
Luciano Henrique Nunes de Almeida 8 years ago
committed by GitHub
parent
commit
1fc0b38de5
  1. 4
      sapl/legacy/migration.py

4
sapl/legacy/migration.py

@ -130,9 +130,7 @@ def get_fk_related(field, value, label=None):
if not field.null:
fields_dict = get_fields_dict(field.related_model)
# Cria stub ao final da tabela para evitar erros
pk = 1
if hasattr(field.related_model.objects.last(), 'pk'):
pk = field.related_model.objects.last().pk
pk = get_last_value(field.related_model)
with reversion.create_revision():
reversion.set_comment('Stub criado pela migração')
value = mommy.make(

Loading…
Cancel
Save