sort positions
This commit is contained in:
parent
94272609bf
commit
223f5217a2
|
|
@ -427,8 +427,8 @@ class EstEmployeeBackSerializer(EmployeeBackSerializers):
|
|||
es_emp = EstablishmentEmployee.objects.filter(
|
||||
employee=obj,
|
||||
establishment_id=establishment_id,
|
||||
).distinct().order_by('position_id').prefetch_related('position', 'position__establishment_type',
|
||||
'position__establishment_subtype')
|
||||
).distinct().order_by('from_date').prefetch_related('position', 'position__establishment_type',
|
||||
'position__establishment_subtype')
|
||||
result = []
|
||||
for item in es_emp:
|
||||
if item.position.establishment_type == establishment_type or \
|
||||
|
|
@ -445,7 +445,6 @@ class EstEmployeeBackSerializer(EmployeeBackSerializers):
|
|||
'position_index_name': item.position.index_name,
|
||||
'position_name_translated': item.position.name_translated,
|
||||
})
|
||||
|
||||
return result
|
||||
|
||||
class Meta:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user