summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Godwin <andrew@aeracode.org>2014-06-05 23:34:13 -0700
committerAndrew Godwin <andrew@aeracode.org>2014-06-05 23:34:13 -0700
commit1fe941adb0570a58cc5d2eb372611ade8d0e8776 (patch)
tree3d60b23b153fef84680a13a454e1cd0a946216d2
parentaa12ea05cee4af5f2655ed9526ad9852419cc82e (diff)
Prevent operation pollution by later operations of fields
-rw-r--r--django/db/migrations/operations/models.py8
1 files changed, 7 insertions, 1 deletions
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()