From a436515196de60ea75ffa39b14a4a82551b79428 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Sat, 16 Jul 2016 22:44:49 +0200 Subject: [PATCH] Add missing return statement. Fix #4272. --- rest_framework/compat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/compat.py b/rest_framework/compat.py index 9c69eaa03..94f64265a 100644 --- a/rest_framework/compat.py +++ b/rest_framework/compat.py @@ -125,7 +125,7 @@ def get_related_model(field): def value_from_object(field, obj): if django.VERSION < (1, 9): return field._get_val_from_obj(obj) - field.value_from_object(obj) + return field.value_from_object(obj) # contrib.postgres only supported from 1.8 onwards.