Kaynağa Gözat

fix section required

xcad 4 ay önce
ebeveyn
işleme
5e7417f299
3 değiştirilmiş dosya ile 6 ekleme ve 14 silme
  1. 2 1
      CHANGELOG.md
  2. 2 6
      cli/core/input/prompt_manager.py
  3. 2 7
      cli/core/prompt.py

+ 2 - 1
CHANGELOG.md

@@ -7,7 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 ## [Unreleased]
 
-...
+### Changed
+- Fixed AttributeError caused by code trying to access a deprecated `section.required` attribute that no longer exists on VariableSection objects.
 
 ## [0.1.0] - 2025-12-10
 

+ 2 - 6
cli/core/input/prompt_manager.py

@@ -22,10 +22,6 @@ class PromptHandler:
 
     def _handle_section_toggle(self, section, collected: dict[str, Any]) -> bool:
         """Handle section toggle variable and return whether section should be enabled."""
-        if section.required:
-            logger.debug(f"Processing required section '{section.key}' without toggle prompt")
-            return True
-
         if not section.toggle:
             return True
 
@@ -34,7 +30,7 @@ class PromptHandler:
             return True
 
         current_value = toggle_var.convert(toggle_var.value)
-        new_value = self._prompt_variable(toggle_var, _required=section.required)
+        new_value = self._prompt_variable(toggle_var, _required=False)
 
         if new_value != current_value:
             collected[toggle_var.name] = new_value
@@ -66,7 +62,7 @@ class PromptHandler:
     def _collect_variable_value(self, variable: Variable, section, collected: dict[str, Any]) -> None:
         """Collect a single variable value and update if changed."""
         current_value = variable.convert(variable.value)
-        new_value = self._prompt_variable(variable, _required=section.required)
+        new_value = self._prompt_variable(variable, _required=False)
 
         if variable.autogenerated and new_value is None:
             collected[variable.name] = None

+ 2 - 7
cli/core/prompt.py

@@ -77,12 +77,7 @@ class PromptHandler:
 
     def _handle_section_toggle(self, section, collected: dict[str, Any]) -> bool:
         """Handle section toggle prompt and return whether section will be enabled."""
-        # Required sections are always enabled
-        if section.required:
-            logger.debug(f"Processing required section '{section.key}' without toggle prompt")
-            return True
-
-        # Handle optional sections with toggle
+        # Handle sections with toggle
         if not section.toggle:
             return True
 
@@ -92,7 +87,7 @@ class PromptHandler:
 
         # Prompt for toggle variable
         current_value = toggle_var.convert(toggle_var.value)
-        new_value = self._prompt_variable(toggle_var, required=section.required)
+        new_value = self._prompt_variable(toggle_var, required=False)
 
         if new_value != current_value:
             collected[toggle_var.name] = new_value