Introduction of Partner Model, adding code to Tenant model
This commit is contained in:
11
common/utils/form_assistants.py
Normal file
11
common/utils/form_assistants.py
Normal file
@@ -0,0 +1,11 @@
|
||||
import json
|
||||
|
||||
from wtforms.validators import ValidationError
|
||||
|
||||
|
||||
def validate_json(form, field):
|
||||
if field.data:
|
||||
try:
|
||||
json.loads(field.data)
|
||||
except json.JSONDecodeError:
|
||||
raise ValidationError('Invalid JSON format')
|
||||
Reference in New Issue
Block a user