disallow empty attributes in entries
This commit is contained in:
parent
ea89e11738
commit
4e54c19ee5
1 changed files with 3 additions and 0 deletions
|
@ -60,6 +60,9 @@ impl TryFrom<&Entry> for models::Entry {
|
|||
type Error = anyhow::Error;
|
||||
|
||||
fn try_from(e: &Entry) -> Result<Self, Self::Error> {
|
||||
if e.attribute.is_empty() {
|
||||
return Err(anyhow!("Attribute cannot be empty."));
|
||||
}
|
||||
let base_entry = models::Entry {
|
||||
identity: e.address()?.encode()?,
|
||||
entity_searchable: match &e.entity {
|
||||
|
|
Loading…
Reference in a new issue