Browse Source

Corrigido bug ao apagar Anexos e salvar Comentarios em Ocorrencias

producao
Marcio Mazza 10 years ago
parent
commit
2c8c828777
  1. 4
      sigi/apps/ocorrencias/admin.py

4
sigi/apps/ocorrencias/admin.py

@ -100,7 +100,7 @@ class OcorrenciaAdmin(admin.ModelAdmin):
servidor = Servidor.objects.get(user=request.user)
instances = formset.save(commit=False)
for instance in instances:
if isinstance(instance, Ocorrencia):
if isinstance(instance, Comentario):
instance.usuario = servidor
if instance.encaminhar_setor and (instance.encaminhar_setor != instance.ocorrencia.setor_responsavel):
instance.ocorrencia.setor_responsavel = instance.encaminhar_setor
@ -109,7 +109,7 @@ class OcorrenciaAdmin(admin.ModelAdmin):
instance.ocorrencia.status = instance.novo_status
instance.ocorrencia.save()
instance.save()
formset.save_m2m()
super(OcorrenciaAdmin, self).save_formset(request, form, formset, change)
admin.site.register(Ocorrencia, OcorrenciaAdmin)

Loading…
Cancel
Save