Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
daanvdk committed Nov 6, 2023
1 parent e1eb507 commit aeab374
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion binder/plugins/views/combined.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def _follow_related(self, fieldspec):
if fieldname not in names:
raise BinderRequestError(f'Field is not a related object {{{fieldname}}}.')

view = views[name]
view = views[fieldname]
return (RelatedModel(fieldname, view.model, None),) + view._follow_related(fieldspec)

def _get_with_ids(self, pks, request, include_annotations, with_map, where_map):
Expand Down
2 changes: 1 addition & 1 deletion binder/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ def _follow_related(self, fieldspec):
except KeyError:
raise BinderRequestError('No model defined for virtual relation field {{{}}}.{{{}}}.'.format(self.model.__name__, fieldname))
except KeyError:
raise Exception('Unknown field {{{}}}.{{{}}}.'.format(self.model.__name__, fieldname))
raise BinderRequestError('Unknown field {{{}}}.{{{}}}.'.format(self.model.__name__, fieldname))


view = self.get_model_view(related_model)
Expand Down

0 comments on commit aeab374

Please sign in to comment.