Skip to content

Commit

Permalink
removed redundant name getter and setter
Browse files Browse the repository at this point in the history
  • Loading branch information
nh916 committed Oct 19, 2023
1 parent 11a535c commit 069f577
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/cript/nodes/primary_nodes/primary_base_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ def name(self, new_name: str) -> None:
-------
None
"""

# temporary fix where I hardcode the min length of name, but in future this needs to be more dynamic
# db schema requires all names to have at least three characters
if len(new_name) < 3:
raise ValueError(f"Invalid node name '{new_name}': The name must be at least 3 characters long to comply with the API's database schema.")

new_attrs = replace(self._json_attrs, name=new_name)
self._update_json_attrs_if_valid(new_attrs)

Expand Down

0 comments on commit 069f577

Please sign in to comment.