mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2025-01-21 14:38:08 +00:00
fix guided tour url
Use a url fragment (<tour>) instead of a classic url param (/?tour=True)
This commit is contained in:
parent
07225c6ddc
commit
8cadb3dc3b
2 changed files with 4 additions and 3 deletions
|
@ -650,5 +650,5 @@ urlpatterns = [
|
||||||
re_path(
|
re_path(
|
||||||
r"^summary_revoke_key/?$", views.summary_revoke_key, name="summary-revoke-key"
|
r"^summary_revoke_key/?$", views.summary_revoke_key, name="summary-revoke-key"
|
||||||
),
|
),
|
||||||
path("guided-tour/", views.toggle_guided_tour),
|
path("guided-tour/<tour>", views.toggle_guided_tour),
|
||||||
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||||
|
|
|
@ -167,8 +167,9 @@ def user_redirect(request, username):
|
||||||
return redirect("user-feed", username=username)
|
return redirect("user-feed", username=username)
|
||||||
|
|
||||||
@login_required
|
@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"""
|
"""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"])
|
request.user.save(broadcast=False, update_fields=["show_guided_tour"])
|
||||||
return redirect("/")
|
return redirect("/")
|
||||||
|
|
Loading…
Reference in a new issue