mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-30 19:43:47 +00:00 
			
		
		
		
	python: Normalize quotes with Black.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
		
				
					committed by
					
						 Tim Abbott
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							11741543da
						
					
				
				
					commit
					6e4c3e41dc
				
			| @@ -8,16 +8,16 @@ from django.utils.translation import ugettext as _ | ||||
| def validate_domain(domain: Optional[str]) -> None: | ||||
|     if domain is None or len(domain) == 0: | ||||
|         raise ValidationError(_("Domain can't be empty.")) | ||||
|     if '.' not in domain: | ||||
|     if "." not in domain: | ||||
|         raise ValidationError(_("Domain must have at least one dot (.)")) | ||||
|     if len(domain) > 255: | ||||
|         raise ValidationError(_("Domain is too long")) | ||||
|     if domain[0] == '.' or domain[-1] == '.': | ||||
|     if domain[0] == "." or domain[-1] == ".": | ||||
|         raise ValidationError(_("Domain cannot start or end with a dot (.)")) | ||||
|     for subdomain in domain.split('.'): | ||||
|     for subdomain in domain.split("."): | ||||
|         if not subdomain: | ||||
|             raise ValidationError(_("Consecutive '.' are not allowed.")) | ||||
|         if subdomain[0] == '-' or subdomain[-1] == '-': | ||||
|         if subdomain[0] == "-" or subdomain[-1] == "-": | ||||
|             raise ValidationError(_("Subdomains cannot start or end with a '-'.")) | ||||
|         if not re.match('^[a-z0-9-]*$', subdomain): | ||||
|         if not re.match("^[a-z0-9-]*$", subdomain): | ||||
|             raise ValidationError(_("Domain can only have letters, numbers, '.' and '-'s.")) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user