Browse Source

HOT-FIX: conserta chamada a next

pull/2579/head
Edward Ribeiro 6 years ago
parent
commit
d831e4fb18
  1. 4
      sapl/base/views.py

4
sapl/base/views.py

@ -1272,14 +1272,14 @@ def get_data_ultima_atualizacao(request):
NormaJuridica.objects.all(). NormaJuridica.objects.all().
order_by('-data_ultima_atualizacao'). order_by('-data_ultima_atualizacao').
values_list('data_ultima_atualizacao', flat=True). values_list('data_ultima_atualizacao', flat=True).
first()] first()] # Retorna [None, None] se inexistem registros
max_data = '' max_data = ''
if datas[0] and datas[1]: if datas[0] and datas[1]:
max_data = max(datas) max_data = max(datas)
else: else:
max_data = next([i for i in datas if i is not None], '') max_data = next(iter([i for i in datas if i is not None]), '')
return JsonResponse({'data_ultima_atualizacao': max_data}) return JsonResponse({'data_ultima_atualizacao': max_data})

Loading…
Cancel
Save