

def get_prereg_drafts(user=None, filters=tuple()):
    prereg_schema = MetaSchema.find_one((Q('name', 'eq', 'Prereg Challenge') & Q('schema_version', 'eq', 2)))
    query = (Q('registration_schema', 'eq', prereg_schema) & Q('approval', 'ne', None))
    if user:
        pass
    return sorted(DraftRegistration.find(query), key=operator.attrgetter('approval.initiation_date'))

dataset/ETHPy150Open CenterForOpenScience/osf.io/admin/pre_reg/views.py get_prereg_drafts/original