def clean_sections(value, qex=None):
    """
    Does a bit of extra filtering that is awkward to do as part of the view function.

    Expects a QS of :model:`courses.Section` as its ``value``; the optional keyword argument ``qex`` is
    expected (but NOT CHECKED) to be a ``Q`` expression. If ``qex`` is provided, it's used to
    perform a preparatory filter on ``value``, before the cleaning.
    """
    if qex:
        value = value.filter(qex)
    return value.filter(meeting__needs_attention=False)