summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2023-04-07 12:08:36 +0200
committerGitHub <noreply@github.com>2023-04-07 18:08:36 +0800
commit88033438aa8214569913899a17b19b57bd609d97 (patch)
tree1cbe2ed4cc63dc4f3b93f2aaaface769a0e278ca /models
parentca5722a0fae6cc16dc99021176596970bbf29caf (diff)
downloadgitea-88033438aa8214569913899a17b19b57bd609d97.tar.gz
gitea-88033438aa8214569913899a17b19b57bd609d97.zip
Support "." char as user name for User/Orgs in RSS/ATOM/GPG/KEYS path ... (#23874)
- close #22301 workaround for https://github.com/go-chi/chi/issues/781
Diffstat (limited to 'models')
-rw-r--r--models/fixtures/action.yml9
-rw-r--r--models/fixtures/user.yml38
-rw-r--r--models/user/user_test.go4
3 files changed, 49 insertions, 2 deletions
diff --git a/models/fixtures/action.yml b/models/fixtures/action.yml
index a75092feb0..af9ce93ba5 100644
--- a/models/fixtures/action.yml
+++ b/models/fixtures/action.yml
@@ -64,3 +64,12 @@
repo_id: 1700 # dangling intentional
is_private: false
created_unix: 1603011541
+
+- id: 9
+ user_id: 34
+ op_type: 12 # close issue
+ act_user_id: 34
+ repo_id: 1 # public
+ is_private: false
+ created_unix: 1680454039
+ content: '4|' # issueId 5
diff --git a/models/fixtures/user.yml b/models/fixtures/user.yml
index 3e302dfb9a..a4a85f6b1a 100644
--- a/models/fixtures/user.yml
+++ b/models/fixtures/user.yml
@@ -1220,3 +1220,41 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+
+-
+ id: 34
+ lower_name: the_34-user.with.all.allowedchars
+ name: the_34-user.with.all.allowedChars
+ full_name: the_1-user.with.all.allowedChars
+ description: 'some [commonmark](https://commonmark.org/)!'
+ email: user34@example.com
+ keep_email_private: false
+ email_notifications_preference: enabled
+ passwd: ZogKvWdyEx:password
+ passwd_hash_algo: dummy
+ must_change_password: false
+ login_source: 0
+ login_name: the_34-user.with.all.allowedchars
+ type: 0
+ salt: ZogKvWdyEx
+ max_repo_creation: -1
+ is_active: true
+ is_admin: false
+ is_restricted: false
+ allow_git_hook: false
+ allow_import_local: false
+ allow_create_organization: false
+ prohibit_login: false
+ avatar: avatar34
+ avatar_email: user34@example.com
+ use_custom_avatar: true
+ num_followers: 0
+ num_following: 0
+ num_stars: 0
+ num_repos: 0
+ num_teams: 0
+ num_members: 0
+ visibility: 0
+ repo_admin_change_team_access: false
+ theme: ""
+ keep_activity_private: false
diff --git a/models/user/user_test.go b/models/user/user_test.go
index fc8f6b8d51..8e78fee6b3 100644
--- a/models/user/user_test.go
+++ b/models/user/user_test.go
@@ -99,13 +99,13 @@ func TestSearchUsers(t *testing.T) {
}
testUserSuccess(&user_model.SearchUserOptions{OrderBy: "id ASC", ListOptions: db.ListOptions{Page: 1}},
- []int64{1, 2, 4, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 20, 21, 24, 27, 28, 29, 30, 32})
+ []int64{1, 2, 4, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 20, 21, 24, 27, 28, 29, 30, 32, 34})
testUserSuccess(&user_model.SearchUserOptions{ListOptions: db.ListOptions{Page: 1}, IsActive: util.OptionalBoolFalse},
[]int64{9})
testUserSuccess(&user_model.SearchUserOptions{OrderBy: "id ASC", ListOptions: db.ListOptions{Page: 1}, IsActive: util.OptionalBoolTrue},
- []int64{1, 2, 4, 5, 8, 10, 11, 12, 13, 14, 15, 16, 18, 20, 21, 24, 27, 28, 29, 30, 32})
+ []int64{1, 2, 4, 5, 8, 10, 11, 12, 13, 14, 15, 16, 18, 20, 21, 24, 27, 28, 29, 30, 32, 34})
testUserSuccess(&user_model.SearchUserOptions{Keyword: "user1", OrderBy: "id ASC", ListOptions: db.ListOptions{Page: 1}, IsActive: util.OptionalBoolTrue},
[]int64{1, 10, 11, 12, 13, 14, 15, 16, 18})