Follow addition of key fields to instances table
This commit is contained in:
parent
1bcad6d7cd
commit
76f1455372
@ -65,6 +65,8 @@ fn new<'a>(args: &ArgMatches<'a>, conn: &Connection) {
|
|||||||
open_registrations: open_reg,
|
open_registrations: open_reg,
|
||||||
short_description_html: String::new(),
|
short_description_html: String::new(),
|
||||||
long_description_html: String::new(),
|
long_description_html: String::new(),
|
||||||
|
private_key: None,
|
||||||
|
public_key: None,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.expect("Couldn't save instance");
|
.expect("Couldn't save instance");
|
||||||
|
@ -359,6 +359,8 @@ impl FromId<DbConn> for Blog {
|
|||||||
open_registrations: true,
|
open_registrations: true,
|
||||||
short_description_html: String::new(),
|
short_description_html: String::new(),
|
||||||
long_description_html: String::new(),
|
long_description_html: String::new(),
|
||||||
|
private_key: None,
|
||||||
|
public_key: None,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})?;
|
})?;
|
||||||
|
@ -25,6 +25,8 @@ pub struct Instance {
|
|||||||
pub default_license: String,
|
pub default_license: String,
|
||||||
pub long_description_html: SafeString,
|
pub long_description_html: SafeString,
|
||||||
pub short_description_html: SafeString,
|
pub short_description_html: SafeString,
|
||||||
|
pub private_key: Option<String>,
|
||||||
|
pub public_key: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Insertable)]
|
#[derive(Clone, Insertable)]
|
||||||
@ -39,6 +41,8 @@ pub struct NewInstance {
|
|||||||
pub default_license: String,
|
pub default_license: String,
|
||||||
pub long_description_html: String,
|
pub long_description_html: String,
|
||||||
pub short_description_html: String,
|
pub short_description_html: String,
|
||||||
|
pub private_key: Option<String>,
|
||||||
|
pub public_key: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
@ -259,6 +263,8 @@ pub(crate) mod tests {
|
|||||||
name: "My instance".to_string(),
|
name: "My instance".to_string(),
|
||||||
open_registrations: true,
|
open_registrations: true,
|
||||||
public_domain: "plu.me".to_string(),
|
public_domain: "plu.me".to_string(),
|
||||||
|
private_key: None,
|
||||||
|
public_key: None,
|
||||||
},
|
},
|
||||||
NewInstance {
|
NewInstance {
|
||||||
default_license: "WTFPL".to_string(),
|
default_license: "WTFPL".to_string(),
|
||||||
@ -270,6 +276,8 @@ pub(crate) mod tests {
|
|||||||
name: "An instance".to_string(),
|
name: "An instance".to_string(),
|
||||||
open_registrations: true,
|
open_registrations: true,
|
||||||
public_domain: "1plu.me".to_string(),
|
public_domain: "1plu.me".to_string(),
|
||||||
|
private_key: None,
|
||||||
|
public_key: None,
|
||||||
},
|
},
|
||||||
NewInstance {
|
NewInstance {
|
||||||
default_license: "CC-0".to_string(),
|
default_license: "CC-0".to_string(),
|
||||||
@ -281,6 +289,8 @@ pub(crate) mod tests {
|
|||||||
name: "Someone instance".to_string(),
|
name: "Someone instance".to_string(),
|
||||||
open_registrations: false,
|
open_registrations: false,
|
||||||
public_domain: "2plu.me".to_string(),
|
public_domain: "2plu.me".to_string(),
|
||||||
|
private_key: None,
|
||||||
|
public_key: None,
|
||||||
},
|
},
|
||||||
NewInstance {
|
NewInstance {
|
||||||
default_license: "CC-0-BY-SA".to_string(),
|
default_license: "CC-0-BY-SA".to_string(),
|
||||||
@ -292,6 +302,8 @@ pub(crate) mod tests {
|
|||||||
name: "Nice day".to_string(),
|
name: "Nice day".to_string(),
|
||||||
open_registrations: true,
|
open_registrations: true,
|
||||||
public_domain: "3plu.me".to_string(),
|
public_domain: "3plu.me".to_string(),
|
||||||
|
private_key: None,
|
||||||
|
public_key: None,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
@ -958,6 +958,8 @@ impl FromId<DbConn> for User {
|
|||||||
open_registrations: true,
|
open_registrations: true,
|
||||||
short_description_html: String::new(),
|
short_description_html: String::new(),
|
||||||
long_description_html: String::new(),
|
long_description_html: String::new(),
|
||||||
|
private_key: None,
|
||||||
|
public_key: None,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})?;
|
})?;
|
||||||
|
Loading…
Reference in New Issue
Block a user