diff --git a/sapl/materia/views.py b/sapl/materia/views.py index 85e58f166..9f1873c71 100644 --- a/sapl/materia/views.py +++ b/sapl/materia/views.py @@ -1410,7 +1410,6 @@ class TramitacaoCrud(MasterDetailCrud): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) - context['user'] = self.request.user return context @@ -2848,3 +2847,16 @@ def get_pdf_docacessorios(request, pk): % external_name) return response + +def configEtiquetaMateriaLegislativaCrud(request): + config = ConfigEtiquetaMateriaLegislativa.objects.last() + if request.method == "POST": + form = ConfigEtiquetaMateriaLegislativaForms(request.POST, instance=config) + if form.is_valid(): + config = form.save(commit=False) + config.published_date = timezone.now() + config.save() + return redirect('materia/config_etiqueta_materia.html', {'form': form}) + else: + form = ConfigEtiquetaMateriaLegislativaForms(instance=config) + return render(request, 'materia/config_etiqueta_materia.html', {'form': form}) diff --git a/sapl/templates/materia/tramitacao_detail.html b/sapl/templates/materia/tramitacao_detail.html index df108ad13..8b2458720 100644 --- a/sapl/templates/materia/tramitacao_detail.html +++ b/sapl/templates/materia/tramitacao_detail.html @@ -3,7 +3,7 @@ {% block detail_content %} {{ block.super }} - {% if user.is_superuser %} + {% if 'materia.detail_tramitacao' in request.user.get_all_permissions %}