Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion flask_rest_jsonapi/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,8 @@ def delete(self, *args, **kwargs):

def _get_relationship_data(self):
"""Get useful data for relationship management"""
relationship_field = request.path.split('/')[-1].replace('-', '_')
url = request.path.rstrip('/')
relationship_field = url.split('/')[-1].replace('-', '_')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is not good because you split on a list so it doesn't works ?


if relationship_field not in get_relationships(self.schema):
raise RelationNotFound("{} has no attribute {}".format(self.schema.__name__, relationship_field))
Expand Down