Monorepo for Tangled

appview/pages: redirect RepoSinglePull to active round

/pull/ID is redirected to /pull/ID/round/N. this makes links to lines in
a diff stable.

Signed-off-by: oppiliappan <me@oppi.li>

authored by

oppiliappan and committed by tangled.org d4c067fd a120ed6b

+8 -1
+8 -1
appview/pulls/pulls.go
··· 297 297 } 298 298 299 299 func (s *Pulls) RepoSinglePull(w http.ResponseWriter, r *http.Request) { 300 - s.repoPullHelper(w, r, false) 300 + pull, ok := r.Context().Value("pull").(*models.Pull) 301 + if !ok { 302 + log.Println("failed to get pull") 303 + s.pages.Notice(w, "pull-error", "Failed to edit patch. Try again later.") 304 + return 305 + } 306 + 307 + http.Redirect(w, r, r.URL.String()+fmt.Sprintf("/round/%d", pull.LastRoundNumber()), http.StatusFound) 301 308 } 302 309 303 310 func (s *Pulls) mergeCheck(r *http.Request, f *models.Repo, pull *models.Pull, stack models.Stack) types.MergeCheckResponse {