summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
Diffstat (limited to 'django')
-rw-r--r--django/db/migrations/operations/special.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/django/db/migrations/operations/special.py b/django/db/migrations/operations/special.py
index 714a6d59f9..40ae1f85b7 100644
--- a/django/db/migrations/operations/special.py
+++ b/django/db/migrations/operations/special.py
@@ -103,7 +103,6 @@ class RunPython(Operation):
"""
reduces_to_sql = False
- reversible = False
def __init__(self, code, reverse_code=None):
# Forwards code
@@ -118,6 +117,10 @@ class RunPython(Operation):
raise ValueError("RunPython must be supplied with callable arguments")
self.reverse_code = reverse_code
+ @property
+ def reversible(self):
+ return self.reverse_code is not None
+
def state_forwards(self, app_label, state):
# RunPython objects have no state effect. To add some, combine this
# with SeparateDatabaseAndState.