Skip to main content

set_sisu_attainment_if_unclaimed

Function set_sisu_attainment_if_unclaimed 

Source
pub async fn set_sisu_attainment_if_unclaimed(
    conn: &mut PgConnection,
    id: Uuid,
    sisu_attainment_id: &str,
    sisu_attainment_type: Option<&str>,
) -> ModelResult<bool>
Expand description

Records the attainment the study registry holds, unless another live row already claims it.

Two rows may legitimately be told about one attainment — a grade improvement Sisu declines names the attainment the first attempt registered — so this returns false instead of failing.