Merge pull request #13081 from AlanCoding/raw_string

Use raw string to satisfy linter rules
This commit is contained in:
Alan Rominger 2022-10-19 12:08:02 -04:00 committed by GitHub
commit 3fc67dc76c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4934,7 +4934,7 @@ class InstanceSerializer(BaseSerializer):
MaxLengthValidator(limit_value=250),
validators.UniqueValidator(queryset=Instance.objects.all()),
RegexValidator(
regex='^localhost$|^127(?:\.[0-9]+){0,2}\.[0-9]+$|^(?:0*\:)*?:?0*1$',
regex=r'^localhost$|^127(?:\.[0-9]+){0,2}\.[0-9]+$|^(?:0*\:)*?:?0*1$',
flags=re.IGNORECASE,
inverse_match=True,
message="hostname cannot be localhost or 127.0.0.1",