def dispatch(self, request, *args, **kwargs):
        """Dispatch method which verifies approprate GET variables exist"""
        # pylint: disable=attribute-defined-outside-init
        # Confirm that both 'email' and 'code' are in request.GET
        if not all(key in request.GET for key in ('email', 'code')):
            raise Http404

        # Validate that the email is a valid email
        self.email = request.GET['email']
        try:
            validate_email(self.email)
        except ValidationError:
            raise Http404

        # Validate that the secret code is legitimate
        if request.GET['code'] != generate_nologin_hash(self.email.lower()):
            raise Http404

        return super(UnsubscribeView, self).dispatch(request, *args, **kwargs)
dataset/ETHPy150Open ofa/connect/open_connect/mailer/views.py/UnsubscribeView.dispatch/original