Skip to content

Commit 385b697

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Fix ldap loginname (go-gitea#18789) Replace deprecated String.prototype.substr() with String.prototype.slice() (go-gitea#18796) Fix problem when self-assign notification (go-gitea#18797) Move editorconfig-checker to lint-backend and remove JS wrapper (go-gitea#18793)
2 parents f5c9d32 + 0cc2675 commit 385b697

File tree

14 files changed

+45
-254
lines changed

14 files changed

+45
-254
lines changed

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,9 @@ lint: lint-frontend lint-backend
313313
lint-frontend: node_modules
314314
npx eslint --color --max-warnings=0 web_src/js build templates *.config.js docs/assets/js
315315
npx stylelint --color --max-warnings=0 web_src/less
316-
npx editorconfig-checker templates
317316

318317
.PHONY: lint-backend
319-
lint-backend: golangci-lint vet
318+
lint-backend: golangci-lint vet editorconfig-checker
320319

321320
.PHONY: watch
322321
watch:
@@ -789,6 +788,13 @@ golangci-lint-check:
789788
curl -sfL "https://raw.githubusercontent.com/golangci/golangci-lint/v${MIN_GOLANGCI_LINT_VER_FMT}/install.sh" | sh -s -- -b $(GOPATH)/bin v$(MIN_GOLANGCI_LINT_VER_FMT); \
790789
fi
791790

791+
.PHONY: editorconfig-checker
792+
editorconfig-checker:
793+
@hash editorconfig-checker > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
794+
$(GO) install github.com/editorconfig-checker/editorconfig-checker/cmd/editorconfig-checker@50adf46752da119dfef66e57be3ce2693ea4aa9c; \
795+
fi
796+
editorconfig-checker templates
797+
792798
.PHONY: docker
793799
docker:
794800
docker build --disable-content-trust=false -t $(DOCKER_REF) .

integrations/signin_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ func TestSignin(t *testing.T) {
5151
{username: "wrongUsername", password: "password", message: i18n.Tr("en", "form.username_password_incorrect")},
5252
{username: "user15", password: "wrongPassword", message: i18n.Tr("en", "form.username_password_incorrect")},
5353
{username: "[email protected]", password: "wrongPassword", message: i18n.Tr("en", "form.username_password_incorrect")},
54-
// test for duplicate email
55-
{username: "[email protected]", password: "password", message: i18n.Tr("en", "form.email_been_used")},
5654
}
5755

5856
for _, s := range samples {

models/user/user_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,20 @@ func TestCreateUserInvalidEmail(t *testing.T) {
235235
assert.True(t, IsErrEmailInvalid(err))
236236
}
237237

238+
func TestCreateUserEmailAlreadyUsed(t *testing.T) {
239+
assert.NoError(t, unittest.PrepareTestDatabase())
240+
241+
user := unittest.AssertExistsAndLoadBean(t, &User{ID: 2}).(*User)
242+
243+
// add new user with user2's email
244+
user.Name = "testuser"
245+
user.LowerName = strings.ToLower(user.Name)
246+
user.ID = 0
247+
err := CreateUser(user)
248+
assert.Error(t, err)
249+
assert.True(t, IsErrEmailAlreadyUsed(err))
250+
}
251+
238252
func TestGetUserIDsByNames(t *testing.T) {
239253
assert.NoError(t, unittest.PrepareTestDatabase())
240254

modules/notification/ui/ui.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ func (ns *notificationService) NotifyPullRevieweDismiss(doer *user_model.User, r
203203
}
204204

205205
func (ns *notificationService) NotifyIssueChangeAssignee(doer *user_model.User, issue *models.Issue, assignee *user_model.User, removed bool, comment *models.Comment) {
206-
if !removed {
206+
if !removed && doer.ID != assignee.ID {
207207
opts := issueNotificationOpts{
208208
IssueID: issue.ID,
209209
NotificationAuthorID: doer.ID,

package-lock.json

Lines changed: 0 additions & 231 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
"wrap-ansi": "8.0.1"
4646
},
4747
"devDependencies": {
48-
"editorconfig-checker": "4.0.2",
4948
"eslint": "8.8.0",
5049
"eslint-plugin-html": "6.2.0",
5150
"eslint-plugin-import": "2.25.4",

0 commit comments

Comments
 (0)