Fix project scheduling (#576)

* Fix project scheduling

* fix comp

* Fix again

* Fix compile err

* Fix compile err

* Fix compile err

* fix random err
This commit is contained in:
Geometrically 2023-04-18 17:12:44 -07:00 committed by GitHub
parent bb80505b76
commit 5c559af936
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -1641,8 +1641,8 @@ pub async fn project_schedule(
)
.await?;
if user.role.is_mod()
|| team_member
if !user.role.is_mod()
&& !team_member
.map(|x| x.permissions.contains(Permissions::EDIT_DETAILS))
.unwrap_or(false)
{
@ -2315,6 +2315,10 @@ pub async fn project_follow(
let user_id: database::models::ids::UserId = user.id.into();
let project_id: database::models::ids::ProjectId = result.id;
if !is_authorized(&result, &Some(user), &pool).await? {
return Ok(HttpResponse::NotFound().body(""));
}
let following = sqlx::query!(
"
SELECT EXISTS(SELECT 1 FROM mod_follows mf WHERE mf.follower_id = $1 AND mf.mod_id = $2)

View File

@ -691,8 +691,8 @@ pub async fn version_schedule(
)
.await?;
if user.role.is_mod()
|| team_member
if !user.role.is_mod()
&& !team_member
.map(|x| x.permissions.contains(Permissions::EDIT_DETAILS))
.unwrap_or(false)
{