]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
migrations: Don't use 'noop'
authorStephen Finucane <stephen@that.guru>
Mon, 23 Jan 2017 09:07:29 +0000 (09:07 +0000)
committerStephen Finucane <stephen@that.guru>
Mon, 23 Jan 2017 09:07:29 +0000 (09:07 +0000)
The 'noop' operation was introduced in Django 1.8, meaning this
operation won't work on Django 1.7. Travis caught this, though I don't
know how it was missed locally.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Fixes: e3cbe493 ("models: Add 'project' field to Series")
patchwork/migrations/0016_series_project.py

index ecd8984bb1c409520e0a0e997d437e3877565782..befd6953f885e9c0f6013eb6bc0b6b3292b021a5 100644 (file)
@@ -5,7 +5,7 @@ from django.db import migrations, models
 import django.db.models.deletion
 
 
-def copy_series_field(apps, schema_editor):
+def forward(apps, schema_editor):
     """Populate the project field from child cover letter/patches."""
     # TODO(stephenfin): Perhaps we'd like to include an SQL variant of the
     # below though I'd imagine it would be rather tricky
@@ -23,6 +23,11 @@ def copy_series_field(apps, schema_editor):
             # Delete it.
             series.delete()
 
+
+def reverse(apps, schema_editor):
+    pass
+
+
 class Migration(migrations.Migration):
 
     dependencies = [
@@ -35,7 +40,7 @@ class Migration(migrations.Migration):
             name='project',
             field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='series', to='patchwork.Project'),
         ),
-        migrations.RunPython(copy_series_field, migrations.RunPython.noop),
+        migrations.RunPython(forward, reverse),
         migrations.AlterField(
             model_name='seriesreference',
             name='msgid',