From 30066bf831d6b4df16358b9e569405d2143ab912 Mon Sep 17 00:00:00 2001 From: Luciano Almeida Date: Tue, 9 Aug 2016 17:32:10 -0300 Subject: [PATCH] Fix removed request.REQUEST in Django 1.9 and fix OSTICKET_URL Signed-off-by: Luciano Almeida --- sigi/apps/diagnosticos/views.py | 4 ++-- sigi/apps/solicitacoes/forms.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/sigi/apps/diagnosticos/views.py b/sigi/apps/diagnosticos/views.py index 3768c57..5435bba 100644 --- a/sigi/apps/diagnosticos/views.py +++ b/sigi/apps/diagnosticos/views.py @@ -272,7 +272,7 @@ def diagnostico_pdf(request, id_diagnostico): def graficos(request): categorias = Categoria.objects.all() - sel_categoria = int(request.REQUEST.get("categoria", "3")) + sel_categoria = int(request.GET.get("categoria", "3")) perguntas = Pergunta.objects.filter(categoria=sel_categoria).all() context = RequestContext(request, { @@ -315,7 +315,7 @@ def grafico_api(request): '#BB9098', '#BDF1ED', ]) - pergunta_slug = request.REQUEST.get('id', None) + pergunta_slug = request.GET.get('id', None) pergunta = get_object_or_404(Pergunta, name=pergunta_slug) if pergunta.datatype == 'one': diff --git a/sigi/apps/solicitacoes/forms.py b/sigi/apps/solicitacoes/forms.py index 614e3c1..b3fda31 100644 --- a/sigi/apps/solicitacoes/forms.py +++ b/sigi/apps/solicitacoes/forms.py @@ -7,7 +7,7 @@ from django import forms from django.db import transaction from django.forms import ModelForm -from sigi.settings.prod import OSTICKET_API_KEY, OSTICKET_URL +from sigi.settings.prod import OSTICKET_API_KEY, OSTICKET_ATENDIMENTO_URL from .models import Solicitacao @@ -27,7 +27,8 @@ def open_osticket(solicitacao): "subject": solicitacao.titulo, "ip": "", "message": solicitacao.resumo} - response = requests.post(OSTICKET_URL, headers=headers, json=data) + response = requests.post(OSTICKET_ATENDIMENTO_URL, + headers=headers, json=data) if response.status_code == requests.codes.created: return response.text else: