def sort_queryset(queryset, request, allowed_sorts, default=None):
    """ Sorts the queryset by one of allowed_sorts based on parameters
    'sort' and 'dir' from request """
    sort = request.GET.get('sort', None)
    if allowed_sorts in sort:
        direction = request.GET.get('dir', 'asc')
        sort = ('-' if direction == 'desc' else '') + sort
        queryset = queryset.order_by(sort)
    elif default:
        queryset = queryset.order_by(default)
    return queryset
dataset/ETHPy150Open django-oscar/django-oscar/src/oscar/views/__init__.py/sort_queryset/swapped operands of `in`