From ae346bd6df5a1928e4939eda03f02ad80cf87dc3 Mon Sep 17 00:00:00 2001 From: Eduardo Edson Batista Cordeiro Alves Date: Tue, 8 Mar 2016 08:40:50 -0300 Subject: [PATCH] Cria template para documento e muda url de sucesso --- protocoloadm/views.py | 3 ++- templates/protocoloadm/criar_documento.html | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 templates/protocoloadm/criar_documento.html diff --git a/protocoloadm/views.py b/protocoloadm/views.py index 9a18dc076..442457322 100644 --- a/protocoloadm/views.py +++ b/protocoloadm/views.py @@ -261,7 +261,8 @@ class CriarDocumentoProtocolo(CreateView): return criar_documento(protocolo) def get_success_url(self): - return reverse('detail_doc_adm', kwargs={'pk': self.object.pk}) + return reverse('protocolo_mostrar', kwargs={'pk': self.kwargs['pk'], + 'ano': self.kwargs['ano']}) class ProtocoloMostrarView(TemplateView): diff --git a/templates/protocoloadm/criar_documento.html b/templates/protocoloadm/criar_documento.html new file mode 100644 index 000000000..8425238f0 --- /dev/null +++ b/templates/protocoloadm/criar_documento.html @@ -0,0 +1,7 @@ +{% extends "crud/form.html" %} +{% load i18n %} +{% load crispy_forms_tags %} + +{% block detail_content %} + {% crispy form %} +{% endblock %}