1👍
✅
You are using same primary key for accessing Report
and the User
:
report = FishingReport.objects.get(id=pk)
comments = Comment.objects.filter(parent_report=pk)
user = User.objects.get(id=pk)
In the URL, pk=5
seems to be the ID of the report you have created and not of the User you are trying to access. And, looking at the stacktrace it seems that there is no user with id 5
in the database.
👤AKS
Source:stackexchange.com