def METHOD_NAME(
    *, db_session, case_severity: CaseSeverity, case_severity_in: CaseSeverityUpdate
) -> CaseSeverity:
    """Updates a case severity."""
    case_severity_data = case_severity.dict()
    update_data = case_severity_in.dict(skip_defaults=True, exclude={"project", "color"})
    for field in case_severity_data:
        if field in update_data:
            setattr(case_severity, field, update_data[field])
    if case_severity_in.color:
        case_severity.color = case_severity_in.color.as_hex()
    db_session.commit()
    return case_severity