Browse Source

Merge pull request #1337 from interlegis/1240-relacao-parlamentar-autor

fix #1240 - Relação entre parlamentares e autores
pull/1350/head
Luciano Henrique Nunes de Almeida 8 years ago
committed by GitHub
parent
commit
963229a1d5
  1. 3
      sapl/legacy/migration.py

3
sapl/legacy/migration.py

@ -327,6 +327,9 @@ def obj_desnecessario(obj):
if (f.one_to_many or f.one_to_one) and f.auto_created] if (f.one_to_many or f.one_to_one) and f.auto_created]
sem_referencia = not any(rr.related_model.objects.filter( sem_referencia = not any(rr.related_model.objects.filter(
**{rr.field.name: obj}).exists() for rr in relacoes) **{rr.field.name: obj}).exists() for rr in relacoes)
if type(obj).__name__ == 'Parlamentar' and sem_referencia and \
obj.autor.all():
sem_referencia = False
return sem_referencia return sem_referencia

Loading…
Cancel
Save