PetterJohanssonTilia / MyCreators

0 stars 0 forks source link

Bug: Redirect for follow/unfollow "NoReverseMatch at /follow/1/" #3

Closed PetterJohanssonTilia closed 4 months ago

PetterJohanssonTilia commented 4 months ago

when clicking follow/unfollow you get the error message NoReverseMatch at /follow/1/ Reverse for 'creator_aboutme' with keyword arguments '{'pk': 1}' not found. 1 pattern(s) tried: ['creator/(?P[^/]+)/\Z']

PetterJohanssonTilia commented 4 months ago

fixed with this commit: 630c182ced43536a4653a3495cf6eac0b8af92d3

inside views.py follow_creator and unfollow_creator Instead of using a pk we're now using the username

changed the lines return redirect('creator_aboutme', pk=pk) into return redirect('creator_aboutme', username=creator.user.username)