[1.7.x] Prevent operation pollution by later operations of fields

This commit is contained in:
Andrew Godwin 2014-06-05 23:34:13 -07:00
parent 9f1c4e4d3f
commit 7d388956ce
1 changed files with 7 additions and 1 deletions

View File

@ -21,7 +21,13 @@ class CreateModel(Operation):
self.bases = bases or (models.Model,)
def state_forwards(self, app_label, state):
state.models[app_label, self.name.lower()] = ModelState(app_label, self.name, self.fields, self.options, self.bases)
state.models[app_label, self.name.lower()] = ModelState(
app_label,
self.name,
list(self.fields),
dict(self.options),
tuple(self.bases),
)
def database_forwards(self, app_label, schema_editor, from_state, to_state):
apps = to_state.render()