Skip to content

Commit 38e3146

Browse files
author
eribeiro
committed
HOT-FIX: conserta bug em recuperar-materia
1 parent c92fd55 commit 38e3146

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

sapl/materia/views.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,9 @@ def recuperar_materia(request):
334334
tipo = TipoMateriaLegislativa.objects.get(pk=request.GET['tipo'])
335335
ano = request.GET.get('ano', '')
336336

337+
if not (tipo and ano):
338+
return JsonResponse({'numero': '', 'ano': ''})
339+
337340
numeracao = None
338341
try:
339342
logger.debug("user=" + username +

sapl/templates/materia/materialegislativa_form.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
var tipo = $("#id_tipo").val()
1010
var ano = $("#id_ano").val()
1111

12-
if (tipo){
12+
if (tipo && ano){
1313
$.get("/materia/recuperar-materia", { tipo: tipo, ano: ano },
1414
function (data, status) {
1515
$("#id_numero").val(data.numero);

0 commit comments

Comments
 (0)