get-data ne retourne que la dernière entrée concernée par un siren

This commit is contained in:
Thomas NOËL 2020-05-19 12:36:27 +02:00
parent c9fc1b6f72
commit 247ccbd2b3
1 changed files with 2 additions and 4 deletions

View File

@ -507,11 +507,9 @@ query getDossiers($demarcheNumber: Int!, $createdSince: ISO8601DateTime, $first:
pass
if siren:
try:
entreprise = Entreprise.objects.get(resource=self, siren=siren)
entreprise = Entreprise.objects.filter(resource=self, siren=siren).order_by('sequence').last()
if entreprise:
return build_result(entreprise)
except Entreprise.DoesNotExist:
pass
return {
'data': {}