Use sorted to force the django.db.models.query.QuerySet to list

Due to the env issue, sometimes the django.db.models.query.QuerySet may
not have pop function