My slots and form are as:
entities:
- email
slots:
user_email:
type: text
influence_conversation: false
mappings:
- type: from_entity
entity: email
conditions:
- active_loop: login_form
forms:
login_form:
required_slots:
- user_email
And my validate_form action:
class ValidateLoginForm(FormValidationAction):
def name(self) -> Text:
return "validate_login_form"
async def validate_user_email(
self,
slot_value: Any,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict
) -> Dict[Text, Any]:
if tracker.get_slot(REQUESTED_SLOT) == USER_EMAIL:
# email validation logic
if valid_email:
return {USER_EMAIL: slot_value}
else:
dispatcher.utter_message(response="utter_unregistered_email")
return {USER_EMAIL: None}
return {USER_EMAIL: tracker.get_slot(USER_EMAIL)}
And now while testing below are 2 cases: #Case1 (Proper functioning)
>> /login
Bot works fine and asks for email
>> put invalid email
Bot works fine and tells its invalid email & asks to put email again
#Case2 (Abnormally skipping validation)
>> /login{{"email":"invalid_email"}}
Bot doesnt run validate_user_email() and thus accepts invalid email as slot value
Bot continues the form
Why is validate_user_email()
being skipped in the second case? Isnt it supoposed to run everytime that specific slot is being filled, irrespective of how it is filled?