fix variable clash

This commit is contained in:
Vivianne Langdon 2022-03-11 22:28:05 -08:00
parent cf53134577
commit d6767e42fc
4 changed files with 8 additions and 8 deletions

View file

@ -27,8 +27,8 @@ class Author(View):
if is_api_request(request): if is_api_request(request):
return ActivitypubResponse(author.to_activity()) return ActivitypubResponse(author.to_activity())
if redirect := maybe_redirect_local_path(request, author): if redirect_local_path := maybe_redirect_local_path(request, author):
return redirect return redirect_local_path
books = ( books = (
models.Work.objects.filter(Q(authors=author) | Q(editions__authors=author)) models.Work.objects.filter(Q(authors=author) | Q(editions__authors=author))

View file

@ -50,8 +50,8 @@ class Book(View):
if not book or not book.parent_work: if not book or not book.parent_work:
raise Http404() raise Http404()
if redirect := not user_statuses and maybe_redirect_local_path(request, book): if redirect_local_path := not user_statuses and maybe_redirect_local_path(request, book):
return redirect return redirect_local_path
# all reviews for all editions of the book # all reviews for all editions of the book
reviews = models.Review.privacy_filter(request.user).filter( reviews = models.Review.privacy_filter(request.user).filter(

View file

@ -131,8 +131,8 @@ class Status(View):
status.to_activity(pure=not is_bookwyrm_request(request)) status.to_activity(pure=not is_bookwyrm_request(request))
) )
if redirect := maybe_redirect_local_path(request, status): if redirect_local_path := maybe_redirect_local_path(request, status):
return redirect return redirect_local_path
visible_thread = ( visible_thread = (
models.Status.privacy_filter(request.user) models.Status.privacy_filter(request.user)

View file

@ -27,8 +27,8 @@ class Group(View):
group = get_object_or_404(models.Group, id=group_id) group = get_object_or_404(models.Group, id=group_id)
group.raise_visible_to_user(request.user) group.raise_visible_to_user(request.user)
if redirect := maybe_redirect_local_path(request, group): if redirect_local_path := maybe_redirect_local_path(request, group):
return redirect return redirect_local_path
lists = ( lists = (
models.List.privacy_filter(request.user) models.List.privacy_filter(request.user)