1
0
mirror of https://github.com/django/django.git synced 2025-10-28 08:06:09 +00:00

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.
This commit is contained in:
Claude Paroz
2014-05-05 20:39:26 +02:00
parent 12474dacef
commit da9cf53cb5
4 changed files with 11 additions and 5 deletions

View File

@@ -6,6 +6,7 @@ from django.db import models
from django.db.models.options import DEFAULT_NAMES, normalize_together
from django.db.models.fields.related import do_pending_lookups
from django.utils import six
from django.utils.encoding import force_text
from django.utils.module_loading import import_string
@@ -132,7 +133,7 @@ class ModelState(object):
def __init__(self, app_label, name, fields, options=None, bases=None):
self.app_label = app_label
self.name = name
self.name = force_text(name)
self.fields = fields
self.options = options or {}
self.bases = bases or (models.Model, )