mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-08 15:44:31 +03:00
Restore seeding of random GH users in seed-db
Co-authored-by: Mikayla <mikayla@zed.dev>
This commit is contained in:
parent
fca8cdcb8e
commit
4d55110452
@ -64,9 +64,9 @@ async fn main() {
|
|||||||
.expect("failed to fetch user")
|
.expect("failed to fetch user")
|
||||||
.is_none()
|
.is_none()
|
||||||
{
|
{
|
||||||
if let Some(email) = &github_user.email {
|
if admin {
|
||||||
db.create_user(
|
db.create_user(
|
||||||
email,
|
&format!("{}@zed.dev", github_user.login),
|
||||||
admin,
|
admin,
|
||||||
db::NewUserParams {
|
db::NewUserParams {
|
||||||
github_login: github_user.login,
|
github_login: github_user.login,
|
||||||
@ -76,15 +76,11 @@ async fn main() {
|
|||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.expect("failed to insert user");
|
.expect("failed to insert user");
|
||||||
} else if admin {
|
} else {
|
||||||
db.create_user(
|
db.get_or_create_user_by_github_account(
|
||||||
&format!("{}@zed.dev", github_user.login),
|
&github_user.login,
|
||||||
admin,
|
Some(github_user.id),
|
||||||
db::NewUserParams {
|
github_user.email.as_deref(),
|
||||||
github_login: github_user.login,
|
|
||||||
github_user_id: github_user.id,
|
|
||||||
invite_count: 5,
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.expect("failed to insert user");
|
.expect("failed to insert user");
|
||||||
|
Loading…
Reference in New Issue
Block a user