Don't asume all non model instances have the get_deferred_fields method (ie: Statistics).

GitLab issue #331
This commit is contained in:
Roberto Rosario
2016-11-04 01:52:33 -04:00
parent d473245fb2
commit 69bcade6fb

View File

@@ -152,7 +152,7 @@ class Menu(object):
resolved_links.append(resolved_link)
# No need for further content object match testing
break
elif resolved_navigation_object.get_deferred_fields() and isinstance(resolved_navigation_object, bound_source):
elif hasattr(resolved_navigation_object, 'get_deferred_fields') and resolved_navigation_object.get_deferred_fields() and isinstance(resolved_navigation_object, bound_source):
# Second try for objects using .defer() or .only()
for link in links:
resolved_link = link.resolve(