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
+13 -8
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
}