diff options
author | Dessalines <tyhou13@gmx.com> | 2019-12-28 20:58:01 -0500 |
---|---|---|
committer | Dessalines <tyhou13@gmx.com> | 2019-12-28 20:58:01 -0500 |
commit | d57b2d486522635485dd3a26df2a6dcfeb0ef634 (patch) | |
tree | 5aaea74460b5a72658ac2cc3dcf17a08195c6cf9 /server/src/api/user.rs | |
parent | a4b9e635ba30b3f7dfaa578b1ec00fa8ed1757e2 (diff) |
Fixing non-existent user profile viewing.
- Fixes #381
Diffstat (limited to 'server/src/api/user.rs')
-rw-r--r-- | server/src/api/user.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/server/src/api/user.rs b/server/src/api/user.rs index 9a343427..a04ba4b2 100644 --- a/server/src/api/user.rs +++ b/server/src/api/user.rs @@ -367,11 +367,13 @@ impl Perform<GetUserDetailsResponse> for Oper<GetUserDetails> { let user_details_id = match data.user_id { Some(id) => id, None => { - User_::read_from_name( + match User_::read_from_name( &conn, data.username.to_owned().unwrap_or("admin".to_string()), - )? - .id + ) { + Ok(user) => user.id, + Err(_e) => return Err(APIError::err(&self.op, "couldnt_find_that_username_or_email"))? + } } }; |