@view_config(request_method='POST')
    def post(self):
        self._redirect_if_logged_in()

        try:
            appstruct = self.form.validate(self.request.POST.items())
        except deform.ValidationFailure:
            return {'form': self.form.render()}

        self._register(username=appstruct['username'],
                       email=appstruct['email'],
                       password=appstruct['password'])

        return httpexceptions.HTTPFound(
            location=self.request.route_url('index'))
Handle submission of the new user registration form.
dataset/ETHPy150Open hypothesis/h/h/accounts/views.py/RegisterController.post