mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-11 11:21:03 +00:00
Update your own suggestions on shelve
This commit is contained in:
parent
f849d785a5
commit
42699a8d25
1 changed files with 5 additions and 0 deletions
|
@ -137,6 +137,11 @@ def update_suggestions_on_follow(sender, instance, created, *args, **kwargs):
|
||||||
# pylint: disable=unused-argument
|
# pylint: disable=unused-argument
|
||||||
def update_rank_on_shelving(sender, instance, *args, **kwargs):
|
def update_rank_on_shelving(sender, instance, *args, **kwargs):
|
||||||
"""when a user shelves or unshelves a book, re-compute their rank"""
|
"""when a user shelves or unshelves a book, re-compute their rank"""
|
||||||
|
# if it's a local user, re-calculate who is rec'ed to them
|
||||||
|
if instance.user.local:
|
||||||
|
suggested_users.rerank_user_suggestions(instance.user)
|
||||||
|
|
||||||
|
# if the user is discoverable, update their rankings
|
||||||
if not instance.user.discoverable:
|
if not instance.user.discoverable:
|
||||||
return
|
return
|
||||||
suggested_users.rerank_obj(instance.user)
|
suggested_users.rerank_obj(instance.user)
|
||||||
|
|
Loading…
Reference in a new issue