summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.travis.yml1
-rw-r--r--server/src/api/user.rs8
-rw-r--r--ui/src/components/user.tsx3
3 files changed, 8 insertions, 4 deletions
diff --git a/.travis.yml b/.travis.yml
index 1e4d4244..dfdcbf7e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -17,7 +17,6 @@ before_install:
- cd server
script:
- cargo build
- - cargo install diesel_cli --no-default-features --features postgres
- diesel migration run
- cargo test
env:
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"))?
+ }
}
};
diff --git a/ui/src/components/user.tsx b/ui/src/components/user.tsx
index 2624a966..6d6a2e0c 100644
--- a/ui/src/components/user.tsx
+++ b/ui/src/components/user.tsx
@@ -777,6 +777,9 @@ export class User extends Component<any, UserState> {
if (msg.error) {
alert(i18n.t(msg.error));
this.state.deleteAccountLoading = false;
+ if (msg.error == 'couldnt_find_that_username_or_email') {
+ this.context.router.history.push('/');
+ }
this.setState(this.state);
return;
} else if (op == UserOperation.GetUserDetails) {