Strings have to be cloned
This commit is contained in:
parent
2dedcdbc53
commit
fdc7da0edf
@ -158,7 +158,7 @@ pub fn create(form: LenientForm<NewBlogForm>, rockets: PlumeRocket) -> RespondOr
|
|||||||
let custom_domain = if *(&form.custom_domain.is_empty()) {
|
let custom_domain = if *(&form.custom_domain.is_empty()) {
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
Some(Host::new(*(&form.custom_domain)))
|
Some(Host::new(form.custom_domain.clone()))
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut errors = match form.validate() {
|
let mut errors = match form.validate() {
|
||||||
|
@ -9,10 +9,10 @@
|
|||||||
@:base(ctx, i18n!(ctx.1, "New Blog"), {}, {}, {
|
@:base(ctx, i18n!(ctx.1, "New Blog"), {}, {}, {
|
||||||
<h1 dir="auto">@i18n!(ctx.1, "Create a blog")</h1>
|
<h1 dir="auto">@i18n!(ctx.1, "Create a blog")</h1>
|
||||||
<form method="post" action="@uri!(blogs::create)">
|
<form method="post" action="@uri!(blogs::create)">
|
||||||
@input!(ctx.1, title (text), "Title", form, errors, "required minlength=\"1\"")
|
@input!(ctx.1, title (text), "Title", form, errors.clone(), "required minlength=\"1\"")
|
||||||
<input type="submit" value="@i18n!(ctx.1, "Create blog")" dir="auto"/>
|
<input type="submit" value="@i18n!(ctx.1, "Create blog")" dir="auto"/>
|
||||||
|
|
||||||
@input!(ctx.1, custom_domain (optional text), "Custom Domain", form, errors.clone(), "")
|
@input!(ctx.1, custom_domain (optional text), "Custom Domain", form, errors, "")
|
||||||
<input type="submit" value="@i18n!(ctx.1, "Make your blog available under a custom domain")" dir="auto"/>
|
<input type="submit" value="@i18n!(ctx.1, "Make your blog available under a custom domain")" dir="auto"/>
|
||||||
</form>
|
</form>
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user