🐛 fix(base.py): fix variable name in if condition to correctly check field name for 'dict' type handling

This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-09-19 15:11:36 -03:00
commit ce35caa59f

View file

@ -140,7 +140,7 @@ class FrontendNode(BaseModel):
@staticmethod @staticmethod
def handle_dict_type(field: TemplateField, _type: str) -> str: def handle_dict_type(field: TemplateField, _type: str) -> str:
"""Handles 'dict' type by replacing it with 'code' or 'file' based on the field name.""" """Handles 'dict' type by replacing it with 'code' or 'file' based on the field name."""
if "dict" in _type.lower() and key == "dict_": if "dict" in _type.lower() and field.name == "dict_":
field.field_type = "file" field.field_type = "file"
field.suffixes = [".json", ".yaml", ".yml"] field.suffixes = [".json", ".yaml", ".yml"]
field.file_types = ["json", "yaml", "yml"] field.file_types = ["json", "yaml", "yml"]