Skip to content

Commit 19e935b

Browse files
committed
Fix bug when trying to create nested folders
1 parent 74978b5 commit 19e935b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/pulp_docs/utils/aggregation.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,10 @@ def repo_grouping(
119119
_repo_content = self.get_children(lookup_path)
120120

121121
# special treatment to quickstart tutorial
122-
quickstart_file = self._pop_quickstart_from(_repo_content)
123-
if content_type.lower() == "tutorials" and quickstart_file:
124-
repo_nav["Quickstart"] = quickstart_file # type: ignore
122+
if content_type.lower() == "tutorials":
123+
quickstart_file = self._pop_quickstart_from(_repo_content)
124+
if quickstart_file:
125+
repo_nav["Quickstart"] = quickstart_file # type: ignore
125126

126127
# doesnt render content-type section if no files inside
127128
if _repo_content:
@@ -134,6 +135,9 @@ def repo_grouping(
134135
def _pop_quickstart_from(self, pathlist: t.List[str]) -> t.Optional[str]:
135136
"""Get quickstart.md file from filelist with case and variations tolerance"""
136137
for path in pathlist:
138+
if not isinstance(path, str):
139+
continue
140+
137141
filename = path.split("/")[-1]
138142
if filename.lower() in ("quickstart.md", "quick-start.md"):
139143
pathlist.remove(path)

0 commit comments

Comments
 (0)