diff --git a/routers/web/repo/issue_lock.go b/routers/web/repo/issue_lock.go index 08b76e555..93f5a588d 100644 --- a/routers/web/repo/issue_lock.go +++ b/routers/web/repo/issue_lock.go @@ -20,14 +20,12 @@ func LockIssue(ctx *context.Context) { } if issue.IsLocked { - ctx.Flash.Error(ctx.Tr("repo.issues.lock_duplicate")) - ctx.Redirect(issue.Link()) + ctx.JSONError(ctx.Tr("repo.issues.lock_duplicate")) return } if !form.HasValidReason() { - ctx.Flash.Error(ctx.Tr("repo.issues.lock.unknown_reason")) - ctx.Redirect(issue.Link()) + ctx.JSONError(ctx.Tr("repo.issues.lock.unknown_reason")) return } @@ -40,7 +38,7 @@ func LockIssue(ctx *context.Context) { return } - ctx.Redirect(issue.Link()) + ctx.JSONRedirect(issue.Link()) } // UnlockIssue unlocks a previously locked issue. @@ -51,8 +49,7 @@ func UnlockIssue(ctx *context.Context) { } if !issue.IsLocked { - ctx.Flash.Error(ctx.Tr("repo.issues.unlock_error")) - ctx.Redirect(issue.Link()) + ctx.JSONError(ctx.Tr("repo.issues.unlock_error")) return } @@ -64,5 +61,5 @@ func UnlockIssue(ctx *context.Context) { return } - ctx.Redirect(issue.Link()) + ctx.JSONRedirect(issue.Link()) } diff --git a/routers/web/repo/issue_pin.go b/routers/web/repo/issue_pin.go index 6586372fc..7c1a306e6 100644 --- a/routers/web/repo/issue_pin.go +++ b/routers/web/repo/issue_pin.go @@ -31,7 +31,7 @@ func IssuePinOrUnpin(ctx *context.Context) { return } - ctx.Redirect(issue.Link()) + ctx.JSONRedirect(issue.Link()) } // IssueUnpin unpins a Issue diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index 0bc168448..0e36e15e5 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -556,7 +556,7 @@
{{if or .PinEnabled .Issue.IsPinned}} -