mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	forms: Fix to_python method signature.
According to the documentation, `to_python` should account for `None` being a possible value to be processed. See also: https://docs.djangoproject.com/en/4.0/howto/custom-model-fields/#converting-values-to-python-objects. Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							7bf58dbede
						
					
				
				
					commit
					56e22e1a92
				
			@@ -511,7 +511,7 @@ class AuthenticationTokenForm(TwoFactorAuthenticationTokenForm):
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class MultiEmailField(forms.Field):
 | 
			
		||||
    def to_python(self, emails: str) -> List[str]:
 | 
			
		||||
    def to_python(self, emails: Optional[str]) -> List[str]:
 | 
			
		||||
        """Normalize data to a list of strings."""
 | 
			
		||||
        if not emails:
 | 
			
		||||
            return []
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user