diff options
| author | Tim Graham <timograham@gmail.com> | 2014-06-06 08:29:27 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-06-06 08:29:27 -0400 |
| commit | b5a54168f90b7000ce3ea06d0332bea1887ababf (patch) | |
| tree | 7445ecb516df872eaf15c91e3bb1e523044e85ec | |
| parent | 1181b8a4a95551659be6737e41e9fc9d23eb8df4 (diff) | |
Fixed flake8 errors.
| -rw-r--r-- | django/db/migrations/autodetector.py | 10 | ||||
| -rw-r--r-- | django/db/migrations/optimizer.py | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/django/db/migrations/autodetector.py b/django/db/migrations/autodetector.py index 0fd37ef5c9..469fd1199f 100644 --- a/django/db/migrations/autodetector.py +++ b/django/db/migrations/autodetector.py @@ -157,7 +157,7 @@ class MigrationAutodetector(object): # Alright, there's a dependency on the same app. for j, op2 in enumerate(ops): if self.check_dependency(op2, dep) and j > i: - ops = ops[:i] + ops[i+1:j+1] + [op] + ops[j+1:] + ops = ops[:i] + ops[i + 1:j + 1] + [op] + ops[j + 1:] found = True break if found: @@ -384,7 +384,7 @@ class MigrationAutodetector(object): name=name, field=field, ), - dependencies = [ + dependencies=[ (dep_app_label, dep_object_name, None, True), ] ) @@ -396,7 +396,7 @@ class MigrationAutodetector(object): name=model_name, unique_together=unique_together, ), - dependencies = [ + dependencies=[ (app_label, model_name, name, True) for name, field in sorted(related_fields.items()) ] @@ -408,7 +408,7 @@ class MigrationAutodetector(object): name=model_name, index_together=index_together, ), - dependencies = [ + dependencies=[ (app_label, model_name, name, True) for name, field in sorted(related_fields.items()) ] @@ -499,7 +499,7 @@ class MigrationAutodetector(object): operations.DeleteModel( name=model_state.name, ), - dependencies = list(set(dependencies)), + dependencies=list(set(dependencies)), ) def generate_added_fields(self): diff --git a/django/db/migrations/optimizer.py b/django/db/migrations/optimizer.py index 81060886a0..2f6ab6be4a 100644 --- a/django/db/migrations/optimizer.py +++ b/django/db/migrations/optimizer.py @@ -51,7 +51,7 @@ class MigrationOptimizer(object): for i, operation in enumerate(operations): # Compare it to each operation after it for j, other in enumerate(operations[i + 1:]): - result = self.reduce(operation, other, operations[i+1:i+j+1]) + result = self.reduce(operation, other, operations[i + 1:i + j + 1]) if result is not None: # Optimize! Add result, then remaining others, then return new_operations.extend(result) |
