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(
3030 ) ) ;
3131 }
3232
33- let ( user, verified, email ) = users:: table
33+ let ( user, verified, user_email ) = users:: table
3434 . left_join ( emails:: table)
3535 . filter ( users:: gh_login. eq ( username) )
3636 . select ( (
@@ -79,7 +79,6 @@ pub async fn list(
7979 . load ( & mut conn)
8080 . await ?;
8181
82- let verified = verified. unwrap_or ( false ) ;
8382 let crates = crates
8483 . into_iter ( )
8584 . map (
@@ -113,14 +112,16 @@ pub async fn list(
113112 )
114113 . collect ( ) ;
115114 Ok ( Json ( AdminListResponse {
116- user_email : verified. then_some ( email) . flatten ( ) ,
115+ user_email,
116+ user_email_verified : verified. unwrap_or_default ( ) ,
117117 crates,
118118 } ) )
119119}
120120
121121#[ derive( Debug , Serialize ) ]
122122pub struct AdminListResponse {
123123 user_email : Option < String > ,
124+ user_email_verified : bool ,
124125 crates : Vec < AdminCrateInfo > ,
125126}
126127
Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ pub struct OkBool {
8787#[ derive( Deserialize , Debug ) ]
8888pub struct AdminListResponse {
8989 user_email : Option < String > ,
90+ user_email_verified : bool ,
9091 crates : Vec < AdminCrateInfo > ,
9192}
9293#[ derive( Deserialize , Debug ) ]
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ async fn index_include_yanked() -> anyhow::Result<()> {
6868 let json = admin. admin_list ( username) . await . good ( ) ;
6969
7070 assert_eq ! ( json
. user_email
. unwrap
( ) , "[email protected] " ) ; 71+ assert ! ( json. user_email_verified) ;
7172 assert_eq ! ( json. crates. len( ) , 2 ) ;
7273
7374 let json_crate_0 = & json. crates [ 0 ] ;
You can’t perform that action at this time.
0 commit comments