Issue in Singal friendship_request_canceled
Closed this issue · 1 comments
Vishal-shakaya commented
When the user cancels the request signal send after that, it causes to not send user instance, at the receiver point
and it show
Error = raise TypeError("Model instances without primary key value are unhashable")
fix is simple :
1 open models.py
2 search friendship_request_canceled
3 then find this code
def cancel(self):
""" cancel this friendship request """
self.delete()
friendship_request_canceled.send(sender=self)
bust_cache("requests", self.to_user.pk)
bust_cache("sent_requests", self.from_user.pk)
return True
4 Replace with
def cancel(self):
""" cancel this friendship request """
friendship_request_canceled.send(sender=self)
self.delete()
bust_cache("requests", self.to_user.pk)
bust_cache("sent_requests", self.from_user.pk)
return True
This Solution may help lot of New Django-friendship Users
frankwiles commented
Thanks someone else also reported this and I just fixed it before seeing yours is all. Thanks!