def accept(self, r, form, event_type=None):

        T = current.T
        response = current.response

        formvars = form.vars
        person_id = formvars.person_id

        success = False

        if not formvars.get("permitted"):
            response.error = T("Event registration not permitted")

        elif person_id:
            event_type_id = event_type.id if event_type else None
            success = self.register_event(person_id, event_type_id)
            if success:
                success = True
                response.confirmation = T("Event registered")
            else:
                response.error = T("Could not register event")

        else:
            response.error = T("Person not found")

        return success

    # -------------------------------------------------------------------------
Helper function to process the form
dataset/ETHPy150Open sahana/eden/modules/s3db/dvr.py/DVRRegisterCaseEvent.accept