mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	mypy: Upgrade mypy from 1.4.1 to 1.5.1.
_default_manager is the same as objects on most of our models. But when a model class is stored in a variable, the type system doesn’t know which model the variable is referring to, so it can’t know that objects even exists (Django doesn’t add it if the user added a custom manager of a different name). django-stubs used to incorrectly assume it exists unconditionally, but it no longer does. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							c99c8f4640
						
					
				
				
					commit
					0ce6dcb905
				
			@@ -186,7 +186,7 @@ def bulk_set_users_or_streams_recipient_fields(
 | 
			
		||||
        if result is not None:
 | 
			
		||||
            result.recipient = recipient
 | 
			
		||||
            objects_to_update.add(result)
 | 
			
		||||
    model.objects.bulk_update(objects_to_update, ["recipient"])
 | 
			
		||||
    model._default_manager.bulk_update(objects_to_update, ["recipient"])
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# This is only sed in populate_db, so doesn't really need tests
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user