diff --git a/report_builder/utils.py b/report_builder/utils.py index 2f5b67af..b7c7314a 100644 --- a/report_builder/utils.py +++ b/report_builder/utils.py @@ -199,11 +199,11 @@ def get_model_from_path_string(root_model, path): except FieldDoesNotExist: return root_model if direct: - if hasattr(field, 'related'): + if hasattr(field, 'remote_field'): try: - root_model = field.related.parent_model() + root_model = field.remote_field.parent_model() except AttributeError: - root_model = field.related.model + root_model = field.remote_field.model else: if hasattr(field, 'related_model'): root_model = field.related_model