🐛 fix(types.py): change default value of "error" field in component_template to None for better consistency and readability

🐛 fix(base.py): change default value of "error" field in FrontendNode class to None for better consistency and readability
This commit is contained in:
gustavoschaedler 2023-07-28 18:32:03 +01:00
commit 2f0ce5fc1b
2 changed files with 2 additions and 2 deletions

View file

@ -359,7 +359,7 @@ def build_invalid_menu(invalid_components):
.get(type(CustomComponent()).__name__)
)
component_template["error"] = component.get("error", "")
component_template["error"] = component.get("error", None)
component_template.get("template").get("code")["value"] = component_code
invalid_menu[menu_name][component_name] = component_template

View file

@ -53,7 +53,7 @@ class FrontendNode(BaseModel):
output_types: List[str] = []
field_formatters: FieldFormatters = Field(default_factory=FieldFormatters)
beta: bool = False
error: str = ""
error: Optional[str] = None
# field formatters is an instance attribute but it is not used in the class
# so we need to create a method to get it