|
|
|
@ -51,7 +51,6 @@ from sapl.compilacao.utils import (DISPOSITIVO_SELECT_RELATED, |
|
|
|
from sapl.crud.base import Crud, CrudAux, CrudListView, make_pagination |
|
|
|
from sapl.settings import BASE_DIR |
|
|
|
|
|
|
|
|
|
|
|
TipoNotaCrud = CrudAux.build(TipoNota, 'tipo_nota') |
|
|
|
TipoVideCrud = CrudAux.build(TipoVide, 'tipo_vide') |
|
|
|
TipoPublicacaoCrud = CrudAux.build(TipoPublicacao, 'tipo_publicacao') |
|
|
|
@ -1480,12 +1479,18 @@ class ActionDeleteDispositivoMixin(ActionsCommonsMixin): |
|
|
|
).first() |
|
|
|
|
|
|
|
data = {} |
|
|
|
if base_anterior: |
|
|
|
data = self.get_json_for_refresh(base_anterior) |
|
|
|
else: |
|
|
|
if not base_anterior or base == base.get_raiz(): |
|
|
|
base_anterior = base.get_nivel_zero_anterior() |
|
|
|
if not base_anterior: |
|
|
|
base_anterior = base |
|
|
|
data = self.get_json_for_refresh(base_anterior) |
|
|
|
|
|
|
|
if base == base_anterior: |
|
|
|
data['pk'] = base.pk |
|
|
|
self.set_message(data, 'danger', _( |
|
|
|
'Base Inicial não pode ser removida'), modal=True) |
|
|
|
else: |
|
|
|
if base != base.get_raiz(): |
|
|
|
data['pai'] = [base.get_raiz().pk] |
|
|
|
|
|
|
|
if ta_base.id != int(self.kwargs['ta_id']): |
|
|
|
|