Remove was_validated from params
This commit is contained in:
parent
45f664bf9c
commit
aef4a809d6
2 changed files with 2 additions and 5 deletions
|
@ -19,7 +19,6 @@ use crate::{
|
|||
pub struct ContactFormParams<'a> {
|
||||
config: Arc<Config>,
|
||||
captcha_solutions: Arc<Mutex<CaptchaSolutions>>,
|
||||
was_validated: bool,
|
||||
persistant_fields: Option<PersistantContactFormFields>,
|
||||
error_message: Option<&'a str>,
|
||||
}
|
||||
|
@ -33,7 +32,6 @@ pub async fn index(
|
|||
render_contact_form(ContactFormParams {
|
||||
config,
|
||||
captcha_solutions,
|
||||
was_validated: false,
|
||||
persistant_fields: None,
|
||||
error_message: None,
|
||||
})
|
||||
|
@ -53,7 +51,7 @@ pub async fn render_contact_form(params: ContactFormParams<'_>) -> Result<Respon
|
|||
lang: ¶ms.config.lang,
|
||||
path_prefix: ¶ms.config.path_prefix,
|
||||
},
|
||||
was_validated: params.was_validated,
|
||||
was_validated: params.persistant_fields.is_some(),
|
||||
id,
|
||||
persistant_fields: params.persistant_fields.unwrap_or_default(),
|
||||
captcha: captcha_base64,
|
||||
|
@ -73,7 +71,6 @@ async fn failed_submission(
|
|||
let params = ContactFormParams {
|
||||
config,
|
||||
captcha_solutions,
|
||||
was_validated: true,
|
||||
persistant_fields: Some(form.persistant_fields),
|
||||
error_message: Some(error_message),
|
||||
};
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<form id="contact-form"
|
||||
action="{{ base.path_prefix }}/"
|
||||
method="post"
|
||||
{% if was_validated %} class="was-validated"{% endif %}
|
||||
{% if was_validated %}class="was-validated"{% endif %}
|
||||
novalidate>
|
||||
<input type="hidden" name="id" value="{{ id }}" required>
|
||||
|
||||
|
|
Loading…
Reference in a new issue