summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorOtto <otto@codeberg.org>2024-12-16 22:00:13 +0100
committerOtto <otto@codeberg.org>2024-12-16 22:00:13 +0100
commit6a4a24e2d7e8d95cc0d6cb49ea7a1e58cc66945c (patch)
treed1ba56e079a8c922db30798d653e421310b201ac /models
parentUpdate dependency @vitest/eslint-plugin to v1.1.16 (forgejo) (#6290) (diff)
parentchore: Update user1 createdunix (diff)
downloadforgejo-6a4a24e2d7e8d95cc0d6cb49ea7a1e58cc66945c.tar.xz
forgejo-6a4a24e2d7e8d95cc0d6cb49ea7a1e58cc66945c.zip
Merge pull request 'Add sorting functionality to `/api/v1/admin/users` endpoint' (#6228) from awiteb/forgejo:sort-user-search-endpoint into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6228 Reviewed-by: Otto <otto@codeberg.org>
Diffstat (limited to 'models')
-rw-r--r--models/fixtures/user.yml42
-rw-r--r--models/user/user_test.go4
2 files changed, 43 insertions, 3 deletions
diff --git a/models/fixtures/user.yml b/models/fixtures/user.yml
index dbc6fc3e38..c23abbb17e 100644
--- a/models/fixtures/user.yml
+++ b/models/fixtures/user.yml
@@ -36,6 +36,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578000
-
id: 2
@@ -74,6 +75,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578010
-
id: 3
@@ -111,6 +113,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578020
-
id: 4
@@ -148,6 +151,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578030
-
id: 5
@@ -185,6 +189,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578040
-
id: 6
@@ -222,6 +227,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578050
-
id: 7
@@ -259,6 +265,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578060
-
id: 8
@@ -296,6 +303,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578070
-
id: 9
@@ -333,7 +341,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
- created_unix: 1730468968
+ created_unix: 1672578080
-
id: 10
@@ -371,6 +379,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578090
-
id: 11
@@ -408,6 +417,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578100
-
id: 12
@@ -445,6 +455,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578110
-
id: 13
@@ -482,6 +493,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578120
-
id: 14
@@ -519,6 +531,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578130
-
id: 15
@@ -556,6 +569,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578140
-
id: 16
@@ -593,6 +607,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578150
-
id: 17
@@ -630,6 +645,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578160
-
id: 18
@@ -667,6 +683,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578170
-
id: 19
@@ -704,6 +721,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578180
-
id: 20
@@ -741,6 +759,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578190
-
id: 21
@@ -778,6 +797,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578200
-
id: 22
@@ -815,6 +835,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578210
-
id: 23
@@ -852,6 +873,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578220
-
id: 24
@@ -889,6 +911,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578230
-
id: 25
@@ -926,6 +949,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578240
-
id: 26
@@ -963,6 +987,7 @@
repo_admin_change_team_access: true
theme: ""
keep_activity_private: false
+ created_unix: 1672578250
-
id: 27
@@ -1000,6 +1025,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578260
-
id: 28
@@ -1037,6 +1063,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578270
-
id: 29
@@ -1074,6 +1101,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578280
-
id: 30
@@ -1111,6 +1139,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578290
-
id: 31
@@ -1148,6 +1177,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578300
-
id: 32
@@ -1185,6 +1215,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578310
-
id: 33
@@ -1222,6 +1253,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578320
-
id: 34
@@ -1260,6 +1292,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578330
-
id: 35
@@ -1297,6 +1330,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578340
-
id: 36
@@ -1334,6 +1368,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578350
-
id: 37
@@ -1371,6 +1406,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578360
-
id: 38
@@ -1408,6 +1444,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578370
-
id: 39
@@ -1445,6 +1482,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578380
-
id: 40
@@ -1482,6 +1520,7 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578390
-
id: 41
@@ -1519,3 +1558,4 @@
repo_admin_change_team_access: false
theme: ""
keep_activity_private: false
+ created_unix: 1672578400
diff --git a/models/user/user_test.go b/models/user/user_test.go
index ee456e3ce4..1c734fa926 100644
--- a/models/user/user_test.go
+++ b/models/user/user_test.go
@@ -771,11 +771,11 @@ func TestGetInactiveUsers(t *testing.T) {
require.NoError(t, unittest.PrepareTestDatabase())
// all inactive users
- // user1's createdunix is 1730468968
+ // user1's createdunix is 1672578000
users, err := user_model.GetInactiveUsers(db.DefaultContext, 0)
require.NoError(t, err)
assert.Len(t, users, 1)
- interval := time.Now().Unix() - 1730468968 + 3600*24
+ interval := time.Now().Unix() - 1672578000 + 3600*24
users, err = user_model.GetInactiveUsers(db.DefaultContext, time.Duration(interval*int64(time.Second)))
require.NoError(t, err)
require.Empty(t, users)