Skip to content

Commit 5bf50a6

Browse files
authored
Merge branch 'main' into lunny/refactor_git
2 parents cf822b3 + e673e42 commit 5bf50a6

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

options/locale/locale_en-US.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,8 @@ openid_connect_desc = The chosen OpenID URI is unknown. Associate it with a new
303303
openid_register_title = Create new account
304304
openid_register_desc = The chosen OpenID URI is unknown. Associate it with a new account here.
305305
openid_signin_desc = Enter your OpenID URI. For example: https://anne.me, bob.openid.org.cn or gnusocial.net/carry.
306-
disable_forgot_password_mail = Account recovery is disabled. Please contact your site administrator.
306+
disable_forgot_password_mail = Account recovery is disabled because no email is set up. Please contact your site administrator.
307+
disable_forgot_password_mail_admin = Account recovery is only available when email is set up. Please set up email to enable account recovery.
307308
email_domain_blacklisted = You cannot register with your email address.
308309
authorize_application = Authorize Application
309310
authorize_redirect_notice = You will be redirected to %s if you authorize this application.
@@ -312,7 +313,6 @@ authorize_application_description = If you grant the access, it will be able to
312313
authorize_title = Authorize "%s" to access your account?
313314
authorization_failed = Authorization failed
314315
authorization_failed_desc = The authorization failed because we detected an invalid request. Please contact the maintainer of the app you've tried to authorize.
315-
disable_forgot_password_mail = Account recovery is disabled. Please contact your site administrator.
316316
sspi_auth_failed = SSPI authentication failed
317317
password_pwned = The password you chose is on a <a target="_blank" rel="noopener noreferrer" href="https://haveibeenpwned.com/Passwords">list of stolen passwords</a> previously exposed in public data breaches. Please try again with a different password.
318318
password_pwned_err = Could not complete request to HaveIBeenPwned

routers/web/user/auth.go

+1
Original file line numberDiff line numberDiff line change
@@ -1478,6 +1478,7 @@ func ForgotPasswd(ctx *context.Context) {
14781478
ctx.Data["Title"] = ctx.Tr("auth.forgot_password_title")
14791479

14801480
if setting.MailService == nil {
1481+
log.Warn(ctx.Tr("auth.disable_forgot_password_mail_admin"))
14811482
ctx.Data["IsResetDisable"] = true
14821483
ctx.HTML(http.StatusOK, tplForgotPassword)
14831484
return

services/repository/push.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -193,16 +193,17 @@ func pushUpdates(optsList []*repo_module.PushUpdateOptions) error {
193193
}
194194

195195
commits = repo_module.ListToPushCommits(l)
196+
197+
if err := repofiles.UpdateIssuesCommit(pusher, repo, commits.Commits, refName); err != nil {
198+
log.Error("updateIssuesCommit: %v", err)
199+
}
200+
196201
if len(commits.Commits) > setting.UI.FeedMaxCommitNum {
197202
commits.Commits = commits.Commits[:setting.UI.FeedMaxCommitNum]
198203
}
199204
commits.CompareURL = repo.ComposeCompareURL(opts.OldCommitID, opts.NewCommitID)
200205
notification.NotifyPushCommits(pusher, repo, opts, commits)
201206

202-
if err := repofiles.UpdateIssuesCommit(pusher, repo, commits.Commits, refName); err != nil {
203-
log.Error("updateIssuesCommit: %v", err)
204-
}
205-
206207
if err = models.RemoveDeletedBranch(repo.ID, branch); err != nil {
207208
log.Error("models.RemoveDeletedBranch %s/%s failed: %v", repo.ID, branch, err)
208209
}

templates/user/auth/forgot_passwd.tmpl

+7-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@
2222
<button class="ui blue button">{{.i18n.Tr "auth.send_reset_mail"}}</button>
2323
</div>
2424
{{else if .IsResetDisable}}
25-
<p class="center">{{.i18n.Tr "auth.disable_forgot_password_mail"}}</p>
25+
<p class="center">
26+
{{if $.IsAdmin}}
27+
{{.i18n.Tr "auth.disable_forgot_password_mail_admin"}}
28+
{{else}}
29+
{{.i18n.Tr "auth.disable_forgot_password_mail"}}
30+
{{end}}
31+
</p>
2632
{{else if .ResendLimited}}
2733
<p class="center">{{.i18n.Tr "auth.resent_limit_prompt"}}</p>
2834
{{end}}

0 commit comments

Comments
 (0)