Format
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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!({
|
||||
|
||||
@@ -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(())
|
||||
|
||||
Reference in New Issue
Block a user