Browse Source

HOT-FIX: Fix checagem de autoria de Proposições

pull/3061/head
Cesar Carvalho 5 years ago
parent
commit
0f234a16c1
  1. 2
      sapl/materia/views.py
  2. 12
      sapl/templates/materia/proposicao_detail.html

2
sapl/materia/views.py

@ -789,7 +789,7 @@ class ProposicaoCrud(Crud):
p = Proposicao.objects.get(id=kwargs['pk']) p = Proposicao.objects.get(id=kwargs['pk'])
msg_error = '' msg_error = ''
if p and p.autor.user == user: if p and p.autor == user.autoruser.autor:
if action == 'send': if action == 'send':
if p.data_envio and p.data_recebimento: if p.data_envio and p.data_recebimento:
msg_error = _('Proposição já foi enviada e recebida.') msg_error = _('Proposição já foi enviada e recebida.')

12
sapl/templates/materia/proposicao_detail.html

@ -3,7 +3,7 @@
{% load tz %} {% load tz %}
{% block sub_actions %} {% block sub_actions %}
{{block.super}} {{block.super}}
{% if user == object.autor.user %} {% if user.autoruser.autor == object.autor %}
<div class="actions btn-group btn-group-sm {%block sub_actions_pull%}{% endblock%}" role="group"> <div class="actions btn-group btn-group-sm {%block sub_actions_pull%}{% endblock%}" role="group">
{% if object.texto_articulado.exists %} {% if object.texto_articulado.exists %}
<a class="btn btn-success" href="{% url 'sapl.materia:proposicao_ta' object.pk%}">{% trans "Texto Eletrônico" %}</a> <a class="btn btn-success" href="{% url 'sapl.materia:proposicao_ta' object.pk%}">{% trans "Texto Eletrônico" %}</a>
@ -15,7 +15,7 @@
{% endif %} {% endif %}
{% endblock sub_actions%} {% endblock sub_actions%}
{% block editions %} {% block editions %}
{% if user == object.autor.user %} {% if user.autoruser.autor == object.autor %}
{% if object.data_envio %} {% if object.data_envio %}
{% block editions_actions_return %} {% block editions_actions_return %}
<div class="actions btn-group" role="group"> <div class="actions btn-group" role="group">
@ -39,7 +39,7 @@
{% endif %} {% endif %}
{% endblock editions %} {% endblock editions %}
{% block detail_content %} {% block detail_content %}
{% if user == object.autor.user %} {% if user.autoruser.autor == object.autor %}
<h2 class="legend">{% model_verbose_name 'sapl.materia.models.Proposicao' %}</h2> <h2 class="legend">{% model_verbose_name 'sapl.materia.models.Proposicao' %}</h2>
<div class="row"> <div class="row">
<div class="col-sm-3"> <div class="col-sm-3">
@ -89,7 +89,7 @@
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<div id="div_id_descricao" class="form-group"> <div id="div_id_descricao" class="form-group">
<p class="control-label">{%field_verbose_name object 'descricao'%}</p> <p class="control-label">{% field_verbose_name object 'descricao' %}</p>
<div class="controls"> <div class="controls">
<div class="form-control-static">{{object.descricao}}</div> <div class="form-control-static">{{object.descricao}}</div>
</div> </div>
@ -100,7 +100,7 @@
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<div id="div_id_obseracao" class="form-group"> <div id="div_id_obseracao" class="form-group">
<p class="control-label">{%field_verbose_name object 'observacao'%}</p> <p class="control-label">{% field_verbose_name object 'observacao' %}</p>
<div class="controls"> <div class="controls">
<div class="form-control-static">{{object.observacao}}</div> <div class="form-control-static">{{object.observacao}}</div>
</div> </div>
@ -155,7 +155,7 @@
{% if object.hash_code %} {% if object.hash_code %}
<div class="col-sm-12"> <div class="col-sm-12">
<div id="div_id_hash_code" class="form-group"> <div id="div_id_hash_code" class="form-group">
<p class="control-label">{%field_verbose_name object 'hash_code'%}</p> <p class="control-label">{% field_verbose_name object 'hash_code' %}</p>
<div class="controls"> <div class="controls">
<div class="form-control-static">{{object.hash_code}}</div> <div class="form-control-static">{{object.hash_code}}</div>
</div> </div>

Loading…
Cancel
Save