From 77042ffdc5a04a03780a920731f9da790bf5dec6 Mon Sep 17 00:00:00 2001 From: Vargha Csongor Date: Thu, 18 Apr 2024 23:10:16 +0200 Subject: [PATCH] Add verified to Person --- backend/memgraph/model.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/memgraph/model.go b/backend/memgraph/model.go index 68a12f7..226c3dd 100644 --- a/backend/memgraph/model.go +++ b/backend/memgraph/model.go @@ -34,6 +34,7 @@ type Person struct { OthersSaid map[string]string `json:"others_said"` Photos map[string]string `json:"photos"` ProfilePicture string `json:"profile_picture"` + verified bool } func (p *Person) ToString() string { @@ -150,6 +151,9 @@ func (p *Person) ToString() string { // Verify checks if the person is valid and does not contain cypher injection it also escapes the delimiters contained in any of the strings func (p *Person) Verify() error { + if p.verified { + return nil + } if err := VerifyString(p.ID); err != nil { return fmt.Errorf("invalid ID type %s", err) } @@ -208,6 +212,8 @@ func (p *Person) Verify() error { p.Photos[key] = EscapeString(value) } + p.verified = true + return nil }