Compare commits
2 Commits
main
...
32d3d0955d
| Author | SHA1 | Date | |
|---|---|---|---|
|
32d3d0955d
|
|||
|
03bd411c18
|
@@ -32,7 +32,6 @@
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
rust-overlay,
|
||||
@@ -52,7 +51,7 @@
|
||||
formatter = alejandra.defaultPackage.${system};
|
||||
packages = import ./nix/package.nix {inherit pkgs rustPlatform;};
|
||||
devShell = import ./nix/shell.nix {
|
||||
inherit inputs pkgs self rustVersion;
|
||||
inherit inputs pkgs rustVersion;
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
self,
|
||||
rustVersion,
|
||||
...
|
||||
}:
|
||||
|
||||
@@ -93,10 +93,14 @@ impl From<ValidationErrors> for ContactError {
|
||||
return Self::ValidationNameError("backend.contact.errors.validation.name".to_owned());
|
||||
}
|
||||
if validator::ValidationErrors::has_error(&Err(value.clone()), "email") {
|
||||
return Self::ValidationEmailError("backend.contact.errors.validation.email".to_owned());
|
||||
return Self::ValidationEmailError(
|
||||
"backend.contact.errors.validation.email".to_owned(),
|
||||
);
|
||||
}
|
||||
if validator::ValidationErrors::has_error(&Err(value), "message") {
|
||||
return Self::ValidationMessageError("backend.contact.errors.validation.message".to_owned());
|
||||
return Self::ValidationMessageError(
|
||||
"backend.contact.errors.validation.message".to_owned(),
|
||||
);
|
||||
}
|
||||
Self::ValidationError("backend.contact.errors.validation.other".to_owned())
|
||||
}
|
||||
@@ -113,9 +117,13 @@ impl From<ContactError> for ContactResponse {
|
||||
success: false,
|
||||
message: match value {
|
||||
ContactError::CouldNotParseRequestEmailAddress(_)
|
||||
| ContactError::ValidationEmailError(_) => "backend.contact.errors.validation.email",
|
||||
| ContactError::ValidationEmailError(_) => {
|
||||
"backend.contact.errors.validation.email"
|
||||
}
|
||||
ContactError::ValidationNameError(_) => "backend.contact.errors.validation.name",
|
||||
ContactError::ValidationMessageError(_) => "backend.contact.errors.validation.message",
|
||||
ContactError::ValidationMessageError(_) => {
|
||||
"backend.contact.errors.validation.message"
|
||||
}
|
||||
ContactError::CouldNotParseSettingsEmail(_)
|
||||
| ContactError::FailedToBuildMessage(_)
|
||||
| ContactError::CouldNotSendEmail(_)
|
||||
|
||||
@@ -161,7 +161,9 @@ impl ContactApi {
|
||||
remote_addr: Option<poem::web::Data<&poem::web::RemoteAddr>>,
|
||||
) -> ContactApiResponse {
|
||||
let body = body.0;
|
||||
if body.honeypot.is_some() {
|
||||
if let Some(ref honeypot) = body.honeypot
|
||||
&& !honeypot.trim().is_empty()
|
||||
{
|
||||
tracing::event!(
|
||||
target: "backend::contact",
|
||||
tracing::Level::INFO,
|
||||
|
||||
Reference in New Issue
Block a user