mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 03:21:05 +00:00
Fix unfollow url syntax in view
This commit is contained in:
parent
08933c9009
commit
3692fe5151
1 changed files with 4 additions and 4 deletions
|
@ -286,11 +286,11 @@ def follow(request, username):
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
def unfollow(request):
|
def unfollow(request, username):
|
||||||
''' unfollow a user '''
|
''' unfollow a user '''
|
||||||
user = request.user
|
to_unfollow = models.User.objects.get(username=username)
|
||||||
to_unfollow = models.User.objects.get(id=request.POST.get('user'))
|
|
||||||
outgoing.handle_outgoing_unfollow(user, to_unfollow)
|
outgoing.handle_outgoing_unfollow(request.user, to_unfollow)
|
||||||
user_slug = to_unfollow.localname if to_unfollow.localname \
|
user_slug = to_unfollow.localname if to_unfollow.localname \
|
||||||
else to_unfollow.username
|
else to_unfollow.username
|
||||||
return redirect('/user/%s' % user_slug)
|
return redirect('/user/%s' % user_slug)
|
||||||
|
|
Loading…
Reference in a new issue