File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ pub async fn list(
30
30
) ) ;
31
31
}
32
32
33
- let ( user, verified, email ) = users:: table
33
+ let ( user, verified, user_email ) = users:: table
34
34
. left_join ( emails:: table)
35
35
. filter ( users:: gh_login. eq ( username) )
36
36
. select ( (
@@ -79,7 +79,6 @@ pub async fn list(
79
79
. load ( & mut conn)
80
80
. await ?;
81
81
82
- let verified = verified. unwrap_or ( false ) ;
83
82
let crates = crates
84
83
. into_iter ( )
85
84
. map (
@@ -113,14 +112,16 @@ pub async fn list(
113
112
)
114
113
. collect ( ) ;
115
114
Ok ( Json ( AdminListResponse {
116
- user_email : verified. then_some ( email) . flatten ( ) ,
115
+ user_email,
116
+ user_email_verified : verified. unwrap_or_default ( ) ,
117
117
crates,
118
118
} ) )
119
119
}
120
120
121
121
#[ derive( Debug , Serialize ) ]
122
122
pub struct AdminListResponse {
123
123
user_email : Option < String > ,
124
+ user_email_verified : bool ,
124
125
crates : Vec < AdminCrateInfo > ,
125
126
}
126
127
Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ pub struct OkBool {
87
87
#[ derive( Deserialize , Debug ) ]
88
88
pub struct AdminListResponse {
89
89
user_email : Option < String > ,
90
+ user_email_verified : bool ,
90
91
crates : Vec < AdminCrateInfo > ,
91
92
}
92
93
#[ derive( Deserialize , Debug ) ]
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ async fn index_include_yanked() -> anyhow::Result<()> {
68
68
let json = admin. admin_list ( username) . await . good ( ) ;
69
69
70
70
assert_eq ! ( json. user_email. unwrap( ) , "foo@example.com" ) ;
71
+ assert ! ( json. user_email_verified) ;
71
72
assert_eq ! ( json. crates. len( ) , 2 ) ;
72
73
73
74
let json_crate_0 = & json. crates [ 0 ] ;
You can’t perform that action at this time.
0 commit comments