Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ def is_valid(self, model_type: str, model_name, model_credential: Dict[str, obje
def encryption_dict(self, model: Dict[str, object]):
return model

cache_folder = forms.TextInputField(_('Model catalog'), required=True)
cache_dir = forms.TextInputField(_('Model catalog'), required=True)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code snippet you provided contains an error: it attempts to define two fields with the same name (cache_folder and cache_dir) using different class attributes. This will likely result in a runtime exception because Python does not allow duplicate attribute names within the same class.

To fix this, you can either use one of the field names consistently or modify the cache_dir definition to include additional information if needed, such as setting its initial value:

class MyForm(forms.Form): # ... other fields ... cache_folder = forms.TextInputField(_('Model catalog'), required=True) def encryption_dict(self, model: Dict[str, object]): return model

If there was no specific intention to have different fields, simply update the existing cache_folder with an appropriate field instance if necessary. If you intended to add new functionality related to directories instead of form caching, ensure that both fields work together appropriately without ambiguity.

Loading