def METHOD_NAME(self, field: StringField):
    pwd = field.data
    confirmed = self["confirm_password"].data
    if pwd != confirmed:
        raise ValidationError(
            _(
                "Passwords differ. Ensure you have typed same password "
                'in both "password" field and "confirm password" field.'
            )
        )