fix: moderation locking fixes (#5843)
* fix: moderation locking fixes * fix: lint * wip: override always available * fix: newmodal base z * fix: cargo fmt
This commit is contained in:
@@ -22,7 +22,7 @@ use async_trait::async_trait;
|
||||
use bytes::Bytes;
|
||||
use serde_json::json;
|
||||
|
||||
use crate::test::database::MOD_USER_PAT;
|
||||
use crate::test::database::ADMIN_USER_PAT;
|
||||
|
||||
use super::{
|
||||
ApiV2,
|
||||
@@ -95,10 +95,10 @@ impl ApiProject for ApiV2 {
|
||||
let resp = self.create_project(creation_data, pat).await;
|
||||
assert_status!(&resp, StatusCode::OK);
|
||||
|
||||
// Approve as a moderator.
|
||||
// Approve as admin so fixture setup is not blocked by the moderation-lock guard.
|
||||
let req = TestRequest::patch()
|
||||
.uri(&format!("/v2/project/{slug}"))
|
||||
.append_pat(MOD_USER_PAT)
|
||||
.append_pat(ADMIN_USER_PAT)
|
||||
.set_json(json!(
|
||||
{
|
||||
"status": "approved"
|
||||
|
||||
@@ -23,7 +23,7 @@ use crate::test::{
|
||||
models::{CommonItemType, CommonProject, CommonVersion},
|
||||
request_data::{ImageData, ProjectCreationRequestData},
|
||||
},
|
||||
database::MOD_USER_PAT,
|
||||
database::ADMIN_USER_PAT,
|
||||
dummy_data::TestFile,
|
||||
};
|
||||
|
||||
@@ -49,10 +49,11 @@ impl ApiProject for ApiV3 {
|
||||
let resp = self.create_project(creation_data, pat).await;
|
||||
assert_status!(&resp, StatusCode::OK);
|
||||
|
||||
// Approve as a moderator.
|
||||
// Approve as admin so fixture setup is not blocked by the moderation-lock guard
|
||||
// (non-admin moderators must hold a lock to move a project out of processing).
|
||||
let req = TestRequest::patch()
|
||||
.uri(&format!("/v3/project/{slug}"))
|
||||
.append_pat(MOD_USER_PAT)
|
||||
.append_pat(ADMIN_USER_PAT)
|
||||
.set_json(json!(
|
||||
{
|
||||
"status": "approved"
|
||||
|
||||
Reference in New Issue
Block a user