From 8cadb3dc3b3450ecc6d1bc3aea61b67bbdad6005 Mon Sep 17 00:00:00 2001 From: Hugh Rundle Date: Mon, 13 Jun 2022 15:22:23 +1000 Subject: [PATCH] fix guided tour url Use a url fragment () instead of a classic url param (/?tour=True) --- bookwyrm/urls.py | 2 +- bookwyrm/views/user.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bookwyrm/urls.py b/bookwyrm/urls.py index e5b04d111..9287c3705 100644 --- a/bookwyrm/urls.py +++ b/bookwyrm/urls.py @@ -650,5 +650,5 @@ urlpatterns = [ re_path( r"^summary_revoke_key/?$", views.summary_revoke_key, name="summary-revoke-key" ), - path("guided-tour/", views.toggle_guided_tour), + path("guided-tour/", views.toggle_guided_tour), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) diff --git a/bookwyrm/views/user.py b/bookwyrm/views/user.py index 502f9b56f..124a2e96c 100644 --- a/bookwyrm/views/user.py +++ b/bookwyrm/views/user.py @@ -167,8 +167,9 @@ def user_redirect(request, username): return redirect("user-feed", username=username) @login_required -def toggle_guided_tour(request): +def toggle_guided_tour(request, tour): """most people don't want a tour every time they load a page""" - request.user.show_guided_tour = request.GET.get("tour") + + request.user.show_guided_tour = tour request.user.save(broadcast=False, update_fields=["show_guided_tour"]) return redirect("/")