directly use SafeString in InstanceSettingsForm
This commit is contained in:
parent
d62c72dde0
commit
06718a5c8a
@ -115,7 +115,7 @@ impl Instance {
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update(&self, conn: &PgConnection, name: String, open_registrations: bool, short_description: String, long_description: String) -> Instance {
|
pub fn update(&self, conn: &PgConnection, name: String, open_registrations: bool, short_description: SafeString, long_description: SafeString) -> Instance {
|
||||||
let (sd, _) = md_to_html(short_description.as_ref());
|
let (sd, _) = md_to_html(short_description.as_ref());
|
||||||
let (ld, _) = md_to_html(long_description.as_ref());
|
let (ld, _) = md_to_html(long_description.as_ref());
|
||||||
diesel::update(self)
|
diesel::update(self)
|
||||||
|
@ -10,7 +10,9 @@ use plume_models::{
|
|||||||
db_conn::DbConn,
|
db_conn::DbConn,
|
||||||
posts::Post,
|
posts::Post,
|
||||||
users::User,
|
users::User,
|
||||||
|
safe_string::SafeString,
|
||||||
instance::*
|
instance::*
|
||||||
|
|
||||||
};
|
};
|
||||||
use inbox::Inbox;
|
use inbox::Inbox;
|
||||||
use routes::Page;
|
use routes::Page;
|
||||||
@ -110,8 +112,8 @@ struct InstanceSettingsForm {
|
|||||||
#[validate(length(min = "1"))]
|
#[validate(length(min = "1"))]
|
||||||
name: String,
|
name: String,
|
||||||
open_registrations: bool,
|
open_registrations: bool,
|
||||||
short_description: String,
|
short_description: SafeString,
|
||||||
long_description: String,
|
long_description: SafeString,
|
||||||
#[validate(length(min = "1"))]
|
#[validate(length(min = "1"))]
|
||||||
default_license: String
|
default_license: String
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user