1
0
Fork 0

Redirect to correct url with slug

This commit is contained in:
Vivianne Langdon 2022-03-02 01:12:32 -08:00
parent ebf463fc91
commit d8181d6d66
7 changed files with 40 additions and 6 deletions

View file

@ -14,7 +14,7 @@ from django.views import View
from bookwyrm import forms, models
from bookwyrm.activitypub import ActivitypubResponse
from bookwyrm.settings import PAGE_LENGTH
from bookwyrm.views.helpers import is_api_request, get_user_from_username
from bookwyrm.views.helpers import is_api_request, get_user_from_username, maybe_redirect_local_path
# pylint: disable=no-self-use
@ -56,6 +56,9 @@ class Shelf(View):
if is_api_request(request) and shelf_identifier:
return ActivitypubResponse(shelf.to_activity(**request.GET))
if r := maybe_redirect_local_path(request, shelf):
return r
reviews = models.Review.objects
if not is_self:
reviews = models.Review.privacy_filter(request.user)