Skip to content

Conversation

rickhonda
Copy link

I noticed that if multiple users are following a target user and one of them tries to unfollow said target user, you get an error:

stream_twitter.models.MultipleObjectsReturned: get() returned more than one Follow -- it returned 2!

Which came from the UnfollowView class in stream-twitter/views.py line 76:

return self.get_queryset().get(target__id=target_id)

So I changed it to:

return self.get_queryset().get(target__id=target_id, user=self.request.user)

Which seems to work...

@rickhonda rickhonda changed the title fixed bug: did not allow unfollow if multiple users follow target fixed bug: Does not allow unfollow if multiple users follow target Oct 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant