From 1fe941adb0570a58cc5d2eb372611ade8d0e8776 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Thu, 5 Jun 2014 23:34:13 -0700 Subject: [PATCH] Prevent operation pollution by later operations of fields --- django/db/migrations/operations/models.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/django/db/migrations/operations/models.py b/django/db/migrations/operations/models.py index 76ec83c40e..06ad280be6 100644 --- a/django/db/migrations/operations/models.py +++ b/django/db/migrations/operations/models.py @@ -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()