registrasion/controllers/conditions.py
def pre_filter(self, queryset, user):
        ''' Returns all of the items from queryset which are enabled by a user
        being a presenter or copresenter of a non-cancelled proposal. '''

        # Filter out cancelled proposals
        queryset = queryset.filter(
            proposal_kind__proposalbase__presentation__cancelled=False
        )

        u = user
        # User is a presenter
        user_is_presenter = Q(
            is_presenter=True,
            proposal_kind__proposalbase__presentation__speaker__user=u,
        )
        # User is a copresenter
        user_is_copresenter = Q(
            is_copresenter=True,
            proposal_kind__proposalbase__presentation__additional_speakers__user=u,  # NOQA
        )

        return queryset.filter(user_is_presenter | user_is_copresenter)
def pre_filter(self, queryset, user):
        ''' Returns all of the items from queryset which are enabled by a user
        being a presenter or copresenter of a non-cancelled proposal. '''

        # Filter out cancelled proposals
        queryset = queryset.filter(
            proposal_kind__proposalbase__presentation__cancelled=False
        )

        u = user
        # User is a presenter
        user_is_presenter = Q(
            is_presenter=True,
            proposal_kind__proposalbase__presentation__speaker__user=u,
        )
        # User is a copresenter
        user_is_copresenter = Q(
            is_copresenter=True,
            proposal_kind__proposalbase__presentation__additional_speakers__user=u,  # NOQA
        )

        return queryset.filter(user_is_presenter | user_is_copresenter)
Returns all of the items from queryset which are enabled by a user
        being a presenter or copresenter of a non-cancelled proposal.