Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def isbn_syntax_validation(form, field):
"""Validate ISBN syntax."""
message = "The provided ISBN is invalid - it should look \
similar to '1413304540', '1-4133-0454-0', '978-1413304541' or \
'978-1-4133-0454-1'."
if field.data and not is_isbn(field.data):
raise StopValidation(message)