aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/utils/model_meta.py
diff options
context:
space:
mode:
Diffstat (limited to 'rest_framework/utils/model_meta.py')
-rw-r--r--rest_framework/utils/model_meta.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/rest_framework/utils/model_meta.py b/rest_framework/utils/model_meta.py
index b6c41174..7a95bcdd 100644
--- a/rest_framework/utils/model_meta.py
+++ b/rest_framework/utils/model_meta.py
@@ -107,8 +107,8 @@ def get_field_info(model):
related=relation.model,
to_many=True,
has_through_model=(
- hasattr(relation.field.rel, 'through') and
- not relation.field.rel.through._meta.auto_created
+ (getattr(relation.field.rel, 'through', None) is not None)
+ and not relation.field.rel.through._meta.auto_created
)
)