Hi,
I want to deactivate a form from inside the slot validation but self.deactivate()
seems not working.
This is my code:
def validate_feed_edit(
self,
value: Text,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
) -> Dict[Text, Any]:
"""Validate confirm value."""
if value == "Edit Soreness":
# requires to fill again the fields "feed_soreness", "feed_confirm" and "feed_edit"
return {"feed_soreness": None, "feed_confirm": None, "feed_edit": None}
elif value == "Edit Lesion Changes":
# requires to fill again the fields "feed_change", "feed_confirm" and "feed_edit"
return {"feed_change": None, "feed_confirm": None, "feed_edit": None}
elif value == "Edit Overall Feedback":
# requires to fill again the fields "feed_overall", "feed_confirm" and "feed_edit"
return {"feed_overall": None, "feed_confirm": None, "feed_edit": None}
elif value == "Abort Operation":
# aborts all operations and sets all slots to None
dispatcher.utter_message("Ok, no action will be done")
return self.deactivate()
And this is the error that I get:
Traceback (most recent call last):
File "c:\users\tizianolabruna\anaconda3\lib\site-packages\flask\app.py", line 2446, in wsgi_app
response = self.full_dispatch_request()
File "c:\users\tizianolabruna\anaconda3\lib\site-packages\flask\app.py", line 1951, in full_dispatch_request
rv = self.handle_user_exception(e)
File "c:\users\tizianolabruna\anaconda3\lib\site-packages\flask_cors\extension.py", line 161, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "c:\users\tizianolabruna\anaconda3\lib\site-packages\flask\app.py", line 1820, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "c:\users\tizianolabruna\anaconda3\lib\site-packages\flask\_compat.py", line 39, in reraise
raise value
File "c:\users\tizianolabruna\anaconda3\lib\site-packages\flask\app.py", line 1949, in full_dispatch_request
rv = self.dispatch_request()
File "c:\users\tizianolabruna\anaconda3\lib\site-packages\flask\app.py", line 1935, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "c:\users\tizianolabruna\anaconda3\lib\site-packages\flask_cors\decorator.py", line 128, in wrapped_function
resp = make_response(f(*args, **kwargs))
File "c:\users\tizianolabruna\anaconda3\lib\site-packages\rasa_sdk\endpoint.py", line 66, in webhook
response = executor.run(action_call)
File "c:\users\tizianolabruna\anaconda3\lib\site-packages\rasa_sdk\executor.py", line 249, in run
events = action(dispatcher, tracker, domain)
File "c:\users\tizianolabruna\anaconda3\lib\site-packages\rasa_sdk\forms.py", line 554, in run
events.extend(self.submit(dispatcher, temp_tracker, domain))
TypeError: 'NoneType' object is not iterable
127.0.0.1 - - [2019-12-11 15:52:09] "POST /webhook HTTP/1.1" 500 411 0.000000