Skip to content

Commit

Permalink
HOT-FIX: conserta bug em recuperar-materia
Browse files Browse the repository at this point in the history
  • Loading branch information
eribeiro committed Nov 19, 2020
1 parent c92fd55 commit 38e3146
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions sapl/materia/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,9 @@ def recuperar_materia(request):
tipo = TipoMateriaLegislativa.objects.get(pk=request.GET['tipo'])
ano = request.GET.get('ano', '')

if not (tipo and ano):
return JsonResponse({'numero': '', 'ano': ''})

numeracao = None
try:
logger.debug("user=" + username +
Expand Down
2 changes: 1 addition & 1 deletion sapl/templates/materia/materialegislativa_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
var tipo = $("#id_tipo").val()
var ano = $("#id_ano").val()

if (tipo){
if (tipo && ano){
$.get("/materia/recuperar-materia", { tipo: tipo, ano: ano },
function (data, status) {
$("#id_numero").val(data.numero);
Expand Down

0 comments on commit 38e3146

Please sign in to comment.