Commit 1fe941ad authored by Andrew Godwin's avatar Andrew Godwin
Browse files

Prevent operation pollution by later operations of fields

parent aa12ea05
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -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()