Exclude staff from CLA check

This commit is contained in:
Max Brunsfeld 2024-01-23 11:31:55 -08:00
parent 8ce7594a26
commit 1fd72d26cb
2 changed files with 14 additions and 8 deletions

View file

@ -42,14 +42,19 @@ impl Database {
}
};
let Some(user) = user::Entity::find().filter(condition).one(&*tx).await? else {
return Ok(None);
};
let Some(contributor) = contributor::Entity::find_by_id(user.id).one(&*tx).await?
else {
return Ok(None);
};
Ok(Some(contributor.signed_at))
if let Some(user) = user::Entity::find().filter(condition).one(&*tx).await? {
if user.admin {
return Ok(Some(user.created_at));
}
if let Some(contributor) =
contributor::Entity::find_by_id(user.id).one(&*tx).await?
{
return Ok(Some(contributor.signed_at));
}
}
Ok(None)
})
.await
}

View file

@ -17,6 +17,7 @@ pub struct Model {
pub inviter_id: Option<UserId>,
pub connected_once: bool,
pub metrics_id: Uuid,
pub created_at: DateTime,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]