Skip to content

Commit f9e1159

Browse files
committed
update save function so tests pass
Signed-off-by: Aayush Kumar <[email protected]>
1 parent 205af36 commit f9e1159

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

scanpipe/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2820,7 +2820,7 @@ def __str__(self):
28202820

28212821
def save(self, *args, **kwargs):
28222822
if self.path and not self.parent_path:
2823-
self.parent_path = self.parent_directory()
2823+
self.parent_path = self.parent_directory() or ""
28242824
super().save(*args, **kwargs)
28252825

28262826
def get_absolute_url(self):

scanpipe/tests/test_views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,8 +1583,8 @@ def test_file_tree_base_url_lists_top_level_nodes(self):
15831583

15841584
url = reverse("codebase_resource_tree", kwargs={"slug": self.project1.slug})
15851585
response = self.client.get(url)
1586-
children = response.context[-1]["children"]
1587-
1586+
children = response.context["children"]
1587+
print(response.context)
15881588
child1 = children[0]
15891589
dir1 = children[1]
15901590

0 commit comments

Comments
 (0)