Update utils.py to handle SecretStr field type as str with password and load_from_db attributes (#2005)
* chore: Update utils.py to handle SecretStr field type as str with password and load_from_db attributes * Update utils.py to handle SecretStr field type as str with password and load_from_db attributes
This commit is contained in:
parent
4c113d5ac0
commit
eb68558905
4 changed files with 16 additions and 11 deletions
|
|
@ -159,6 +159,11 @@ def add_new_custom_field(
|
|||
if field_type == "bool" and field_value is None:
|
||||
field_value = False
|
||||
|
||||
if field_type == "SecretStr":
|
||||
field_config["password"] = True
|
||||
field_config["load_from_db"] = True
|
||||
field_config["input_types"] = ["Text"]
|
||||
|
||||
# If options is a list, then it's a dropdown
|
||||
# If options is None, then it's a list of strings
|
||||
is_list = isinstance(field_config.get("options"), list)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue