mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-23 12:51:18 +00:00
parent
b4b8e9d7f5
commit
3a85515bd5
3 changed files with 8 additions and 4 deletions
1
.travis.yml
vendored
1
.travis.yml
vendored
|
@ -17,7 +17,6 @@ before_install:
|
||||||
- cd server
|
- cd server
|
||||||
script:
|
script:
|
||||||
- cargo build
|
- cargo build
|
||||||
- cargo install diesel_cli --no-default-features --features postgres
|
|
||||||
- diesel migration run
|
- diesel migration run
|
||||||
- cargo test
|
- cargo test
|
||||||
env:
|
env:
|
||||||
|
|
|
@ -367,11 +367,13 @@ impl Perform<GetUserDetailsResponse> for Oper<GetUserDetails> {
|
||||||
let user_details_id = match data.user_id {
|
let user_details_id = match data.user_id {
|
||||||
Some(id) => id,
|
Some(id) => id,
|
||||||
None => {
|
None => {
|
||||||
User_::read_from_name(
|
match User_::read_from_name(
|
||||||
&conn,
|
&conn,
|
||||||
data.username.to_owned().unwrap_or("admin".to_string()),
|
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"))?
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
3
ui/src/components/user.tsx
vendored
3
ui/src/components/user.tsx
vendored
|
@ -777,6 +777,9 @@ export class User extends Component<any, UserState> {
|
||||||
if (msg.error) {
|
if (msg.error) {
|
||||||
alert(i18n.t(msg.error));
|
alert(i18n.t(msg.error));
|
||||||
this.state.deleteAccountLoading = false;
|
this.state.deleteAccountLoading = false;
|
||||||
|
if (msg.error == 'couldnt_find_that_username_or_email') {
|
||||||
|
this.context.router.history.push('/');
|
||||||
|
}
|
||||||
this.setState(this.state);
|
this.setState(this.state);
|
||||||
return;
|
return;
|
||||||
} else if (op == UserOperation.GetUserDetails) {
|
} else if (op == UserOperation.GetUserDetails) {
|
||||||
|
|
Loading…
Reference in a new issue