diff --git a/plume-models/src/instance.rs b/plume-models/src/instance.rs index 8e071689..525c968e 100644 --- a/plume-models/src/instance.rs +++ b/plume-models/src/instance.rs @@ -149,6 +149,7 @@ impl Instance { open_registrations: bool, short_description: SafeString, long_description: SafeString, + default_license: String, ) -> Result<()> { let (sd, _, _) = md_to_html( short_description.as_ref(), @@ -170,6 +171,7 @@ impl Instance { instances::long_description.eq(long_description), instances::short_description_html.eq(sd), instances::long_description_html.eq(ld), + instances::default_license.eq(default_license), )) .execute(conn) .map(|_| ()) @@ -482,6 +484,7 @@ pub(crate) mod tests { false, SafeString::new("[short](#link)"), SafeString::new("[long_description](/with_link)"), + "CC-BY-SAO".to_owned(), ) .unwrap(); let inst = Instance::get(conn, inst.id).unwrap(); @@ -500,6 +503,7 @@ pub(crate) mod tests { inst.short_description_html, SafeString::new("

short

\n") ); + assert_eq!(inst.default_license, "CC-BY-SAO".to_owned()); Ok(()) }); diff --git a/src/routes/instance.rs b/src/routes/instance.rs index be8b124c..2c309e7a 100644 --- a/src/routes/instance.rs +++ b/src/routes/instance.rs @@ -136,6 +136,7 @@ pub fn update_settings( form.open_registrations, form.short_description.clone(), form.long_description.clone(), + form.default_license.clone(), ) .expect("instance::update_settings: save error"); Flash::success(