Skip to main content

ensure_unique_url_path

Function ensure_unique_url_path 

Source
async fn ensure_unique_url_path(
    conn: &mut PgConnection,
    course_id: Uuid,
    base_path: &str,
) -> ModelResult<String>
Expand description

Appends a numeric suffix to base_path until it no longer collides with an existing (non-deleted) page in the course, so deriving slugs from duplicate or empty titles cannot hit the unique (course_id, url_path) constraint and abort the migration.