Monorepo for Tangled tangled.org

appview/pages: redirect RepoSinglePull to active round #1019

merged opened by oppi.li targeting master from op/qslykqvmryow

/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

Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:qfpnj4og54vl56wngdriaxug/sh.tangled.repo.pull/3mdcnzffnll22
+8 -1
Diff #0
+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 {

History

1 round 0 comments
sign up or login to add to the discussion
oppi.li submitted #0
1 commit
expand
appview/pages: redirect RepoSinglePull to active round
3/3 success
expand
expand 0 comments
pull request successfully merged