mirror of
				https://github.com/django/django.git
				synced 2025-10-31 01:25:32 +00:00 
			
		
		
		
	Fixed #21786: Bad behaviour when mixins + abstract bases for migrations
This commit is contained in:
		| @@ -147,11 +147,16 @@ class ModelState(object): | ||||
|                     options[name] = model._meta.original_attrs[name] | ||||
|         # Make our record | ||||
|         bases = tuple( | ||||
|             ("%s.%s" % (base._meta.app_label, base._meta.model_name) if hasattr(base, "_meta") else base) | ||||
|             ( | ||||
|                 "%s.%s" % (base._meta.app_label, base._meta.model_name) | ||||
|                 if hasattr(base, "_meta") else | ||||
|                 base | ||||
|             ) | ||||
|             for base in model.__bases__ | ||||
|             if (not hasattr(base, "_meta") or not base._meta.abstract) | ||||
|         ) | ||||
|         if not bases: | ||||
|         # Ensure at least one base inherits from models.Model | ||||
|         if not any((isinstance(base, six.string_types) or issubclass(base, models.Model)) for base in bases): | ||||
|             bases = (models.Model, ) | ||||
|         return cls( | ||||
|             model._meta.app_label, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user