mirror of
				https://github.com/django/django.git
				synced 2025-10-26 07:06:08 +00:00 
			
		
		
		
	Simplified widgets.Select._choice_has_empty_value().
This commit is contained in:
		| @@ -681,7 +681,7 @@ class Select(ChoiceWidget): | |||||||
|     def _choice_has_empty_value(choice): |     def _choice_has_empty_value(choice): | ||||||
|         """Return True if the choice's value is empty string or None.""" |         """Return True if the choice's value is empty string or None.""" | ||||||
|         value, _ = choice |         value, _ = choice | ||||||
|         return (isinstance(value, str) and not value) or value is None |         return value is None or value == '' | ||||||
|  |  | ||||||
|     def use_required_attribute(self, initial): |     def use_required_attribute(self, initial): | ||||||
|         """ |         """ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user