diff --git a/sapl/api/views.py b/sapl/api/views.py index f73af6b50..9884079db 100644 --- a/sapl/api/views.py +++ b/sapl/api/views.py @@ -59,8 +59,10 @@ def get_mesa_diretora(request): kwargs = {} legislatura = request.GET.get('legislatura') - if legislatura: - kwargs['legislatura_id'] = legislatura + if not legislatura: + legislatura = Legislatura.objects.order_by('-data_inicio').first().id + + kwargs['legislatura_id'] = legislatura sessao = request.GET.get('sessao') if sessao: @@ -739,7 +741,4 @@ class AppVersionView(APIView): 'user': request.user.username, 'is_authenticated': request.user.is_authenticated, } - return Response(content) - - - + return Response(content) \ No newline at end of file