diff --git a/entity/models.py b/entity/models.py index 8085648..3852642 100644 --- a/entity/models.py +++ b/entity/models.py @@ -338,7 +338,7 @@ def get_membership_cache(self, group_ids=None, is_active=True): if group_ids: membership_queryset = membership_queryset.filter(entity_group_id__in=group_ids) - membership_queryset = membership_queryset.order_by('id') + membership_queryset = membership_queryset.order_by('sort_order', 'id') membership_queryset = membership_queryset.values_list('entity_group_id', 'entity_id', 'sub_entity_kind_id')