This makes todo.sr.ht's behavior consistent with other sr.ht services
by returning a 404 if you try to omit the tilde in a tracker URL. The
second commit also fixes the "Create & configure tracker" button
redirecting you to https://todo.sr.ht/username/tracker without a tilde.
Fixes https://todo.sr.ht/~sircmpwn/todo.sr.ht/198
Benjamin Lowry (2):
get_tracker: return None if tilde is ommitted
redirect to correct page when creating & configuring tracker
todosrht/access.py | 36 +++++++++++++++++-----------------
todosrht/blueprints/tracker.py | 2 +-
2 files changed, 19 insertions(+), 19 deletions(-)
--
2.26.2
Use canonical_name to redirect to the tracker page with
a tilde before the username.
Signed-off-by: Benjamin Lowry <ben@ben.gmbh>
---
todosrht/blueprints/tracker.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/todosrht/blueprints/tracker.py b/todosrht/blueprints/tracker.py
index 68cde2c..4d3a5ae 100644
--- a/todosrht/blueprints/tracker.py+++ b/todosrht/blueprints/tracker.py
@@ -53,7 +53,7 @@ def create_POST():
if "create-configure" in valid:
return redirect(url_for("settings.details_GET",
- owner=current_user.username,+ owner=current_user.canonical_name, name=tracker.name))
return redirect(tracker_url(tracker))
--
2.26.2