From 6ef391b2e8ef71a85d627ea19fa1bada9c8a3b8f Mon Sep 17 00:00:00 2001 From: Ben Visness Date: Tue, 9 Nov 2021 11:23:36 -0800 Subject: [PATCH] Redirect to generated personal project slug --- src/website/routes.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/website/routes.go b/src/website/routes.go index 042c4a8..a53d73c 100644 --- a/src/website/routes.go +++ b/src/website/routes.go @@ -284,6 +284,11 @@ func NewWebsiteRoutes(longRequestContext context.Context, conn *pgxpool.Pool, pe return c.Redirect(hmnurl.BuildOfficialProjectHomepage(p.Project.Slug), http.StatusSeeOther) } + if c.PathParams["slug"] != models.GeneratePersonalProjectSlug(p.Project.Name) { + // TODO: Redirect to the same page on the other path + return c.Redirect(hmnurl.BuildPersonalProject(p.Project.ID, models.GeneratePersonalProjectSlug(p.Project.Name)), http.StatusSeeOther) + } + c.CurrentProject = &p.Project return h(c)