Skip to content

Commit

Permalink
Merge pull request #2957 from hughrun/redisfix
Browse files Browse the repository at this point in the history
fix illegal values in redis jobs
  • Loading branch information
mouse-reeve authored Aug 19, 2023
2 parents c6aaa80 + 5ed1441 commit 0f8da5b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bookwyrm/activitystreams.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def _get_audience(self, status): # pylint: disable=no-self-use
trace.get_current_span().set_attribute("status_privacy", status.privacy)
trace.get_current_span().set_attribute(
"status_reply_parent_privacy",
status.reply_parent.privacy if status.reply_parent else None,
status.reply_parent.privacy if status.reply_parent else status.privacy,
)
# direct messages don't appear in feeds, direct comments/reviews/etc do
if status.privacy == "direct" and status.status_type == "Note":
Expand Down
3 changes: 2 additions & 1 deletion bookwyrm/suggested_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,8 @@ def rerank_suggestions_task(user_id):
def rerank_user_task(user_id, update_only=False):
"""do the hard work in celery"""
user = models.User.objects.get(id=user_id)
suggested_users.rerank_obj(user, update_only=update_only)
if user:
suggested_users.rerank_obj(user, update_only=update_only)


@app.task(queue=SUGGESTED_USERS)
Expand Down

0 comments on commit 0f8da5b

Please sign in to comment.