diff --git a/sapl/materia/views.py b/sapl/materia/views.py index 2b5dc5697..94f10f539 100644 --- a/sapl/materia/views.py +++ b/sapl/materia/views.py @@ -772,7 +772,7 @@ class ProposicaoCrud(Crud): context['title'] = '%s (%s)' % ( self.object, self.object.autor) - + context['user'] = self.request.user context['proposicao'] = Proposicao.objects.get( pk=self.kwargs['pk'] @@ -782,7 +782,8 @@ class ProposicaoCrud(Crud): def get(self, request, *args, **kwargs): action = request.GET.get('action', '') - username = request.user.username + user = request.user + username = user.username if not action: return Crud.DetailView.get(self, request, *args, **kwargs) @@ -790,7 +791,7 @@ class ProposicaoCrud(Crud): p = Proposicao.objects.get(id=kwargs['pk']) msg_error = '' - if p: + if p and p.autor.user == user: if action == 'send': if p.data_envio and p.data_recebimento: msg_error = _('Proposição já foi enviada e recebida.') diff --git a/sapl/templates/materia/proposicao_detail.html b/sapl/templates/materia/proposicao_detail.html index b35d3de8b..487cc8600 100644 --- a/sapl/templates/materia/proposicao_detail.html +++ b/sapl/templates/materia/proposicao_detail.html @@ -3,204 +3,213 @@ {% load tz %} {% block sub_actions %} {{block.super}} -
{%field_verbose_name object 'tipo'%}
-{%field_verbose_name object 'tipo'%}
+{%field_verbose_name object 'data_envio' %}
-{%field_verbose_name object 'data_envio' %}
+{%field_verbose_name object 'data_recebimento'%}
-{%field_verbose_name object 'data_recebimento'%}
+{%field_verbose_name object 'descricao'%}
-{%field_verbose_name object 'observacao'%}
+{%field_verbose_name object 'descricao'%}