diff --git a/prod.py b/prod.py new file mode 120000 index 0000000..01f8fd6 --- /dev/null +++ b/prod.py @@ -0,0 +1 @@ +dev.py \ No newline at end of file diff --git a/sigi/apps/solicitacoes/forms.py b/sigi/apps/solicitacoes/forms.py index 6153e68..b2f1d0c 100644 --- a/sigi/apps/solicitacoes/forms.py +++ b/sigi/apps/solicitacoes/forms.py @@ -24,7 +24,7 @@ def open_osticket(solicitacao): "ip": "", "message": solicitacao.resumo} response = requests.post(OSTICKET_URL, headers=headers, json=data) - if response.status_code == requests.codes.ok: + if response.status_code == requests.codes.created: return response.text else: response.raise_for_status() diff --git a/sigi/apps/solicitacoes/views.py b/sigi/apps/solicitacoes/views.py index 3ca4f3b..5999cc2 100644 --- a/sigi/apps/solicitacoes/views.py +++ b/sigi/apps/solicitacoes/views.py @@ -2,6 +2,7 @@ from __future__ import absolute_import import random from django.contrib.auth.mixins import LoginRequiredMixin +from django.core.urlresolvers import reverse import sigi.apps.crud.base from sigi.apps.crud.base import Crud, CrudCreateView, CrudListView, CrudCreateView, CrudUpdateView, CrudBaseMixin @@ -27,7 +28,10 @@ class SolicitacaoCrud(LoginRequiredMixin, Crud): self.initial[u'telefone_contato'] = usuario.primeiro_telefone except Usuario.DoesNotExist: pass - return self.initial.copy() # TODO: por que? + return self.initial.copy() + + def get_success_url(self): + return reverse(u'solicitacoes:solicitacao_list') class UpdateView(LoginRequiredMixin, CrudUpdateView): form_class = SolicitacaoEditForm @@ -42,7 +46,8 @@ class SolicitacaoCrud(LoginRequiredMixin, Crud): return u'SolicitacaoList' class BaseMixin(CrudBaseMixin): - list_field_names = [u'codigo', u'sistema', u'titulo', u'data_criacao'] + list_field_names = [u'osticket', u'sistema', + u'titulo', u'data_criacao'] class SistemaCrud(Crud):