Skip to content

Commit

Permalink
Revert hascustomalias to False when alias regenerated
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtylerwalls committed Nov 5, 2024
1 parent 1183311 commit a70058f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions arches/app/models/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -2117,6 +2117,7 @@ def create_node_alias(self, node):
n.alias for n in self.nodes.values() if node.alias != n.alias
]
node.alias = self.make_name_unique(row[0], aliases, "_n")
node.hascustomalias = False
return node.alias

def validate(self):
Expand Down
7 changes: 4 additions & 3 deletions tests/models/node_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ def test_missing_alias_supplied(self):
def test_empty_custom_alias_regenerated(self):
"""One dubiously empty alias per graph is currently allowed at the
database level. Ensure it is regenerated via the application."""
new_node = Node(graph_id=self.graph.pk, name="Test node")
new_node.hascustomalias = True
new_node.alias = ""
new_node = Node(
graph_id=self.graph.pk, name="Test node", alias="", hascustomalias=True
)
new_node.clean()
self.assertEqual(new_node.alias, "test_node")
self.assertIs(new_node.hascustomalias, False)

0 comments on commit a70058f

Please sign in to comment.