Skip to content

Commit 3dd1cee

Browse files
strktechknowlogick
authored andcommitted
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"
1 parent 43c0249 commit 3dd1cee

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

integrations/user_test.go

+14-1
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,22 @@ func TestRenameReservedUsername(t *testing.T) {
7474
prepareTestEnv(t)
7575

7676
reservedUsernames := []string{
77+
"admin",
78+
"api",
79+
"attachments",
80+
"avatars",
81+
"explore",
7782
"help",
78-
"user",
83+
"install",
84+
"issues",
85+
"login",
86+
"metrics",
87+
"notifications",
88+
"org",
89+
"pulls",
90+
"repo",
7991
"template",
92+
"user",
8093
}
8194

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

models/user.go

+1
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,7 @@ func NewGhostUser() *User {
776776

777777
var (
778778
reservedUsernames = []string{
779+
"attachments",
779780
"admin",
780781
"api",
781782
"assets",

0 commit comments

Comments
 (0)