Skip to content
Snippets Groups Projects
Commit 17120d7a authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[algorithms][serializers] Simplified result ordering

parent 30d72dcf
No related branches found
No related tags found
2 merge requests!2551.4.x,!242Py3 compatibility
......@@ -26,6 +26,7 @@
###############################################################################
from rest_framework import serializers
from operator import itemgetter
from ..code.serializers import CodeSerializer, CodeCreationSerializer
from ..libraries.serializers import LibraryReferenceSerializer
......@@ -95,12 +96,7 @@ class AlgorithmSerializer(CodeSerializer):
referencing_experiments = serializer.data
# Put the pending experiments first
ordered_result = filter(lambda x: x['creation_date'] is None, \
referencing_experiments)
ordered_result += filter(lambda x: x['creation_date'] is not None, \
referencing_experiments)
return ordered_result
return sorted(referencing_experiments, key=itemgetter('creation_date'))
#----------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment