Skip to content

Commit 388111b

Browse files
committed
fixup! feat: add audit logs for dormancy events
1 parent e84b893 commit 388111b

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

coderd/database/dbmem/dbmem.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7711,7 +7711,7 @@ func (q *FakeQuerier) InsertUser(_ context.Context, arg database.InsertUserParam
77117711

77127712
status := database.UserStatusDormant
77137713
if arg.Status != "" {
7714-
status = arg.Status
7714+
status = database.UserStatus(arg.Status)
77157715
}
77167716

77177717
user := database.User{

coderd/database/queries.sql.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries/users.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ INSERT INTO
7171
status
7272
)
7373
VALUES
74-
($1, $2, $3, $4, $5, $6, $7, $8, $9, NULLIF(@status::user_status, '')) RETURNING *;
74+
($1, $2, $3, $4, $5, $6, $7, $8, $9, NULLIF(@status::text, '')::user_status) RETURNING *;
7575

7676
-- name: UpdateUserProfile :one
7777
UPDATE

coderd/users.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ func (api *API) postFirstUser(rw http.ResponseWriter, r *http.Request) {
195195
OrganizationIDs: []uuid.UUID{defaultOrg.ID},
196196
},
197197
LoginType: database.LoginTypePassword,
198+
Status: database.UserStatusActive,
198199
accountCreatorName: "coder",
199200
})
200201
if err != nil {
@@ -1355,7 +1356,7 @@ func (api *API) CreateUser(ctx context.Context, store database.Store, req Create
13551356
// All new users are defaulted to members of the site.
13561357
RBACRoles: []string{},
13571358
LoginType: req.LoginType,
1358-
Status: req.Status,
1359+
Status: string(req.Status),
13591360
}
13601361
// If a user signs up with OAuth, they can have no password!
13611362
if req.Password != "" {

0 commit comments

Comments
 (0)