Resetting MultipleObjectMixin pagination when filtering in get_queryset
===

I'm using a custom mixin to apply a filter to the queryset of a class based view that is paginated with MultipleObjectMixin. When I apply the filter such that the current page outside the range of the dataset, I obviously get a 404. What I want to do is catch this exception and have it redirect to the new last page instead.

My get_queryset for the view in question:

    def get_queryset(self):
        filters = self.build_location_filter()
        if not filters == None:
            return models.Account.corporateAccounts(locations=self.build_location_filter)
        else:
            return models.Account.corporateAccounts()

Any suggestions?