summaryrefslogtreecommitdiff
path: root/django/db/backends
diff options
context:
space:
mode:
authorAndrew Godwin <andrew@aeracode.org>2013-08-11 00:01:30 +0100
committerAndrew Godwin <andrew@aeracode.org>2013-08-11 00:01:30 +0100
commit21be9fef7b14edd75c6ee402ec2bb28bf9b6ce59 (patch)
tree1988dacf1df9f129c5fc6e9449cc91ad49b33051 /django/db/backends
parent77028194415cb03b1ff2a85a86d806a0366bccff (diff)
Stop being overcautious about Field.rel
Diffstat (limited to 'django/db/backends')
-rw-r--r--django/db/backends/schema.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/backends/schema.py b/django/db/backends/schema.py
index 191e72c53a..1e1376a4e2 100644
--- a/django/db/backends/schema.py
+++ b/django/db/backends/schema.py
@@ -437,7 +437,7 @@ class BaseDatabaseSchemaEditor(object):
}
)
# Drop any FK constraints, we'll remake them later
- if getattr(old_field, "rel"):
+ if old_field.rel:
fk_names = self._constraint_names(model, [old_field.column], foreign_key=True)
if strict and len(fk_names) != 1:
raise ValueError("Found wrong number (%s) of foreign key constraints for %s.%s" % (
@@ -584,7 +584,7 @@ class BaseDatabaseSchemaEditor(object):
}
)
# Does it have a foreign key?
- if getattr(new_field, "rel"):
+ if new_field.rel:
self.execute(
self.sql_create_fk % {
"table": self.quote_name(model._meta.db_table),