physionet-build
physionet-build copied to clipboard
validate_aws_id is broken
The code in pull #2101 is wrong:
def validate_aws_id(value):
""""
Validate an AWS ID.
"""
aws_id_pattern = r"\b\d{12}\b"
if value is not None and not re.search(aws_id_pattern, value):
raise ValidationError(
"Invalid AWS ID. Please provide a valid AWS ID, which should be a 12-digit number."
)
Yes, this rejects plenty of things that are not valid AWS IDs, but does it reject everything that is not a valid AWS ID?
What does re.search do?