Skip to content

Commit

Permalink
Prevent operation pollution by later operations of fields
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewgodwin committed Jun 6, 2014
1 parent aa12ea0 commit 1fe941a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion django/db/migrations/operations/models.py
Expand Up @@ -21,7 +21,13 @@ def __init__(self, name, fields, options=None, bases=None):
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()
Expand Down

0 comments on commit 1fe941a

Please sign in to comment.