<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check_password_confirm(self, form, trigger_action_group=None):
 """Checks that the password and the confirm password match in the provided form. Won't do anything if any of the password fields are not in the form. """

        pwcol = self.options['password_column']
        pwconfirmfield = pwcol + "_confirm"
        if pwcol in form and pwconfirmfield in form and form[pwconfirmfield].data != form[pwcol].data:
            if self.options["password_confirm_failed_message"]:
                flash(self.options["password_confirm_failed_message"], "error")
            current_context.exit(trigger_action_group=trigger_action_group)