diff --git a/readthedocs/projects/forms.py b/readthedocs/projects/forms.py index 853470838a3..81d1ebeae7f 100644 --- a/readthedocs/projects/forms.py +++ b/readthedocs/projects/forms.py @@ -621,7 +621,7 @@ def clean_project(self): return self.project def clean_domain(self): - domain = self.cleaned_data['domain'] + domain = self.cleaned_data['domain'].lower() parsed = urlparse(domain) # Force the scheme to have a valid netloc. diff --git a/readthedocs/projects/validators.py b/readthedocs/projects/validators.py index 6156f8e4443..b6e272e7e36 100644 --- a/readthedocs/projects/validators.py +++ b/readthedocs/projects/validators.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - """Validators for projects app.""" import re @@ -12,39 +10,13 @@ from django.utils.translation import ugettext_lazy as _ -domain_regex = ( - r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}(?