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"
tags/v1.10.0-rc1
Sandro Santilli 4 years ago
parent
commit
3dd1cee331
2 changed files with 15 additions and 1 deletions
  1. 14
    1
      integrations/user_test.go
  2. 1
    0
      models/user.go

+ 14
- 1
integrations/user_test.go View File

prepareTestEnv(t) prepareTestEnv(t)


reservedUsernames := []string{ reservedUsernames := []string{
"admin",
"api",
"attachments",
"avatars",
"explore",
"help", "help",
"user",
"install",
"issues",
"login",
"metrics",
"notifications",
"org",
"pulls",
"repo",
"template", "template",
"user",
} }


session := loginUser(t, "user2") session := loginUser(t, "user2")

+ 1
- 0
models/user.go View File



var ( var (
reservedUsernames = []string{ reservedUsernames = []string{
"attachments",
"admin", "admin",
"api", "api",
"assets", "assets",

Loading…
Cancel
Save