Browse Source

Fix #767

pull/906/head
Eduardo Edson Batista Cordeiro Alves 8 years ago
parent
commit
da76c151f8
  1. 12
      sapl/base/views.py

12
sapl/base/views.py

@ -386,6 +386,18 @@ class CasaLegislativaCrud(CrudAux):
list_field_names = ['codigo', 'nome', 'sigla']
form_class = CasaLegislativaForm
class ListView(CrudAux.ListView):
def get(self, request, *args, **kwargs):
casa = get_casalegislativa()
if casa:
return HttpResponseRedirect(
reverse('sapl.base:casalegislativa_detail',
kwargs={'pk': casa.pk}))
else:
return HttpResponseRedirect(
reverse('sapl.base:casalegislativa_create'))
class DetailView(CrudAux.DetailView):
def get(self, request, *args, **kwargs):

Loading…
Cancel
Save