Browse Source

adicionar order_by para evitar erro no distinct

Signed-off-by: Luciano Almeida <lucianoalmeida@interlegis.leg.br>
pull/1496/head
Luciano Almeida 7 years ago
parent
commit
be55fc450c
  1. 2
      sapl/legacy/migration.py

2
sapl/legacy/migration.py

@ -256,7 +256,7 @@ def recria_constraints():
args_string = '' args_string = ''
args_string += "(" + ', '.join(map(str, args)) + ")" args_string += "(" + ', '.join(map(str, args)) + ")"
distintos = model.objects.distinct(*args) distintos = model.objects.order_by(*args).distinct(*args)
todos = model.objects.all() todos = model.objects.all()
if hasattr(model, "content_type"): if hasattr(model, "content_type"):
distintos = distintos.exclude(content_type_id=None, distintos = distintos.exclude(content_type_id=None,

Loading…
Cancel
Save