Skip to content

Commit eca22d3

Browse files
committed
Format
1 parent 6c1afee commit eca22d3

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

crates/handlers/src/admin/v1/users/deactivate.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ mod tests {
158158
response.assert_status(StatusCode::OK);
159159
let body: serde_json::Value = response.json();
160160

161-
// The locked_at timestamp should be the same as the current time, or null if not locked
161+
// The locked_at timestamp should be the same as the current time, or null if
162+
// not locked
162163
assert_eq!(
163164
body["data"]["attributes"]["locked_at"],
164165
if !skip_lock.unwrap_or(false) {

crates/handlers/src/admin/v1/users/unlock.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ pub async fn handler(
127127
mod tests {
128128
use hyper::{Request, StatusCode};
129129
use mas_matrix::{HomeserverConnection, ProvisionRequest};
130-
use mas_storage::{user::UserRepository, Clock, RepositoryAccess};
130+
use mas_storage::{Clock, RepositoryAccess, user::UserRepository};
131131
use sqlx::PgPool;
132132

133133
use crate::test_utils::{RequestBuilderExt, ResponseExt, TestState, setup};
@@ -202,7 +202,8 @@ mod tests {
202202
let mx_user = state.homeserver_connection.query_user(&mxid).await.unwrap();
203203
assert!(mx_user.deactivated);
204204

205-
let request = Request::post(format!("/api/admin/v1/users/{}/unlock", user.id)).bearer(&token);
205+
let request =
206+
Request::post(format!("/api/admin/v1/users/{}/unlock", user.id)).bearer(&token);
206207
let request = match skip_reactivate {
207208
None => request.empty(),
208209
Some(skip_reactivate) => request.json(serde_json::json!({

crates/tasks/src/user.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,11 @@ impl RunnableJob for ReactivateUserJob {
139139

140140
// We want to unlock the user from our side only once it has been reactivated on
141141
// the homeserver
142-
let _user = repo.user().reactivate_and_unlock(user).await.map_err(JobError::retry)?;
142+
let _user = repo
143+
.user()
144+
.reactivate_and_unlock(user)
145+
.await
146+
.map_err(JobError::retry)?;
143147
repo.save().await.map_err(JobError::retry)?;
144148

145149
Ok(())

0 commit comments

Comments
 (0)