diff --git a/crates/handlers/src/admin/v1/users/deactivate.rs b/crates/handlers/src/admin/v1/users/deactivate.rs index 316b882be..815178f62 100644 --- a/crates/handlers/src/admin/v1/users/deactivate.rs +++ b/crates/handlers/src/admin/v1/users/deactivate.rs @@ -158,7 +158,8 @@ mod tests { response.assert_status(StatusCode::OK); let body: serde_json::Value = response.json(); - // The locked_at timestamp should be the same as the current time, or null if not locked + // The locked_at timestamp should be the same as the current time, or null if + // not locked assert_eq!( body["data"]["attributes"]["locked_at"], if !skip_lock.unwrap_or(false) { diff --git a/crates/handlers/src/admin/v1/users/unlock.rs b/crates/handlers/src/admin/v1/users/unlock.rs index 224d6a81b..b82b716a9 100644 --- a/crates/handlers/src/admin/v1/users/unlock.rs +++ b/crates/handlers/src/admin/v1/users/unlock.rs @@ -127,7 +127,7 @@ pub async fn handler( mod tests { use hyper::{Request, StatusCode}; use mas_matrix::{HomeserverConnection, ProvisionRequest}; - use mas_storage::{user::UserRepository, Clock, RepositoryAccess}; + use mas_storage::{Clock, RepositoryAccess, user::UserRepository}; use sqlx::PgPool; use crate::test_utils::{RequestBuilderExt, ResponseExt, TestState, setup}; @@ -202,7 +202,8 @@ mod tests { let mx_user = state.homeserver_connection.query_user(&mxid).await.unwrap(); assert!(mx_user.deactivated); - let request = Request::post(format!("/api/admin/v1/users/{}/unlock", user.id)).bearer(&token); + let request = + Request::post(format!("/api/admin/v1/users/{}/unlock", user.id)).bearer(&token); let request = match skip_reactivate { None => request.empty(), Some(skip_reactivate) => request.json(serde_json::json!({ diff --git a/crates/tasks/src/user.rs b/crates/tasks/src/user.rs index 01864764a..f7ce2f9ff 100644 --- a/crates/tasks/src/user.rs +++ b/crates/tasks/src/user.rs @@ -139,7 +139,11 @@ impl RunnableJob for ReactivateUserJob { // We want to unlock the user from our side only once it has been reactivated on // the homeserver - let _user = repo.user().reactivate_and_unlock(user).await.map_err(JobError::retry)?; + let _user = repo + .user() + .reactivate_and_unlock(user) + .await + .map_err(JobError::retry)?; repo.save().await.map_err(JobError::retry)?; Ok(())