mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	[1.7.x] Fixed #22564 -- Prevented unneeded bytestrings in migrations
In some cases, this could lead to migrations written with Python 2
being incompatible with Python 3.
Thanks Tim Graham for the report and Loïc Bistuer for the advices.
Backport of da9cf53cb from master.
			
			
This commit is contained in:
		| @@ -124,6 +124,8 @@ class MigrationWriter(object): | ||||
|                 dependencies.append("        migrations.swappable_dependency(settings.%s)," % dependency[1]) | ||||
|                 imports.add("from django.conf import settings") | ||||
|             else: | ||||
|                 # No need to output bytestrings for dependencies | ||||
|                 dependency = tuple([force_text(s) for s in dependency]) | ||||
|                 dependencies.append("        %s," % self.serialize(dependency)[0]) | ||||
|         items["dependencies"] = "\n".join(dependencies) + "\n" if dependencies else "" | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user