Skip to content

Commit b3a0ec4

Browse files
committed
fix
1 parent 780c7e1 commit b3a0ec4

File tree

5 files changed

+4
-36
lines changed

5 files changed

+4
-36
lines changed

routers/web/repo/fork.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,5 +228,5 @@ func ForkPost(ctx *context.Context) {
228228
}
229229

230230
log.Trace("Repository forked[%d]: %s/%s", forkRepo.ID, ctxUser.Name, repo.Name)
231-
ctx.Redirect(ctxUser.HomeLink() + "/" + url.PathEscape(repo.Name))
231+
ctx.JSONRedirect(ctxUser.HomeLink() + "/" + url.PathEscape(repo.Name))
232232
}

templates/repo/pulls/fork.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</h3>
77
<div class="ui attached segment">
88
{{template "base/alert" .}}
9-
<form class="ui form left-right-form" action="{{.Link}}" method="post" data-prevent-duplicate>
9+
<form class="ui form form-fetch-action left-right-form" action="{{.Link}}" method="post">
1010
{{.CsrfTokenHtml}}
1111
<div class="inline required field {{if .Err_Owner}}error{{end}}">
1212
<label>{{ctx.Locale.Tr "repo.owner"}}</label>
@@ -75,7 +75,7 @@
7575

7676
<div class="inline field">
7777
<label></label>
78-
<button class="ui primary button{{if not .CanForkRepoInNewOwner}} disabled{{end}}" type="submit">
78+
<button class="ui primary button{{if not .CanForkRepoInNewOwner}} disabled{{end}}">
7979
{{ctx.Locale.Tr "repo.fork_repo"}}
8080
</button>
8181
</div>

tests/integration/repo_fork_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func testRepoFork(t *testing.T, session *TestSession, ownerName, repoName, forkO
5151
"repo_name": forkRepoName,
5252
"fork_single_branch": forkBranch,
5353
})
54-
session.MakeRequest(t, req, http.StatusSeeOther)
54+
session.MakeRequest(t, req, http.StatusOK)
5555

5656
// Step4: check the existence of the forked repo
5757
req = NewRequestf(t, "GET", "/%s/%s", forkOwnerName, forkRepoName)

web_src/js/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ import {initGlobalButtonClickOnEnter, initGlobalButtons, initGlobalDeleteButton}
6565
import {initGlobalComboMarkdownEditor, initGlobalEnterQuickSubmit, initGlobalFormDirtyLeaveConfirm} from './features/common-form.ts';
6666
import {callInitFunctions} from './modules/init.ts';
6767
import {initRepoViewFileTree} from './features/repo-view-file-tree.ts';
68-
import {initFormSubmitHandlers} from './modules/form.ts';
6968

7069
initGiteaFomantic();
7170
initSubmitEventPolyfill();
@@ -86,7 +85,6 @@ onDomReady(() => {
8685
initGlobalComboMarkdownEditor,
8786
initGlobalDeleteButton,
8887
initGlobalInput,
89-
initFormSubmitHandlers,
9088

9189
initCommonOrganization,
9290
initCommonIssueListQuickGoto,

web_src/js/modules/form.ts

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)