Skip to content

Commit

Permalink
Merge branch 'fix/57-ignore-attributes-with-special-characters' into …
Browse files Browse the repository at this point in the history
…fix/58-ignore-sql-keywords-from-custom-fields
  • Loading branch information
Sachinbisht27 authored Jun 29, 2024
2 parents 592501f + 82ef38c commit d75c9e2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/services/user_attribute_service.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import re
from typing import Any

from api import db, models
Expand All @@ -17,8 +18,10 @@ def handle_contact_fields_data(self, contact_data: dict[str, Any]):
self.user_id
)
for field_key, field_value in contact_fields_data.items():
if field_key.lower() == "name":

if not re.match(r"^\w+$", field_key) or field_key.lower() == "name":
continue

value = field_value.get("value")
user_attribute = existing_attributes.get(field_key)

Expand Down

0 comments on commit d75c9e2

Please sign in to comment.