Prevent operation pollution by later operations of fields

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

View File

@ -21,7 +21,13 @@ class CreateModel(Operation):
self.bases = bases or (models.Model,) self.bases = bases or (models.Model,)
def state_forwards(self, app_label, state): 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): def database_forwards(self, app_label, schema_editor, from_state, to_state):
apps = to_state.render() apps = to_state.render()