diff --git a/protocoloadm/views.py b/protocoloadm/views.py index 96376486e..2c274d18c 100644 --- a/protocoloadm/views.py +++ b/protocoloadm/views.py @@ -2,7 +2,7 @@ from datetime import date, datetime from re import sub from crispy_forms.helper import FormHelper -from crispy_forms.layout import ButtonHolder, Field, Fieldset, Layout, Submit +from crispy_forms.layout import ButtonHolder, HTML, Field, Fieldset, Layout, Submit from django import forms from django.core.exceptions import ObjectDoesNotExist from django.core.urlresolvers import reverse @@ -326,7 +326,12 @@ class AnularProcoloAdmForm(forms.Form): self.helper = FormHelper() self.helper.layout = Layout( Fieldset('IdentificaĆ§Ć£o do Protocolo', - row1, row2) + row1, + row2, + HTML(" "), + ButtonHolder(Submit('submit', 'Anular', + css_class='button primary')) + ) ) super(AnularProcoloAdmForm, self).__init__( *args, **kwargs) @@ -361,7 +366,8 @@ class AnularProtocoloAdmView(FormMixin, GenericView): ano = request.POST['ano_protocolo'] justificativa_anulacao = sub(' ', ' ', strip_tags( request.POST['justificativa_anulacao'])) - user_anulacao = "NOUSER" # TODO get user from session + + user_anulacao = request.user.username ip_addr = get_client_ip(request) try: diff --git a/templates/protocoloadm/anular_protocoloadm.html b/templates/protocoloadm/anular_protocoloadm.html index 34fdf570f..97e772690 100644 --- a/templates/protocoloadm/anular_protocoloadm.html +++ b/templates/protocoloadm/anular_protocoloadm.html @@ -3,10 +3,5 @@ {% load crispy_forms_tags %} {% block detail_content %}
{{ message }}
-
- {% csrf_token %} - {% crispy form %} -
- -
+ {% crispy form %} {% endblock detail_content %} \ No newline at end of file