Browse Source

Test more reserved usernames (#8263)

* Test more reserved usernames

* Add more reserved usernames, sort them

* Reserve "attachments" username (is a used route)

* It's "avatars" being reserved, not "avatar"
release/v1.10
Sandro Santilli 3 years ago
committed by techknowlogick
parent
commit
3dd1cee331
  1. 15
      integrations/user_test.go
  2. 1
      models/user.go

15
integrations/user_test.go

@ -74,9 +74,22 @@ func TestRenameReservedUsername(t *testing.T) {
prepareTestEnv(t)
reservedUsernames := []string{
"admin",
"api",
"attachments",
"avatars",
"explore",
"help",
"user",
"install",
"issues",
"login",
"metrics",
"notifications",
"org",
"pulls",
"repo",
"template",
"user",
}
session := loginUser(t, "user2")

1
models/user.go

@ -776,6 +776,7 @@ func NewGhostUser() *User {
var (
reservedUsernames = []string{
"attachments",
"admin",
"api",
"assets",

Loading…
Cancel
Save