Hide menu when no children menu.

This commit is contained in:
long2ice
2020-10-15 12:54:44 +08:00
parent e12176c211
commit 0e95a7b146
4 changed files with 7 additions and 2 deletions

View File

@@ -5,4 +5,4 @@ def version():
# with open("pyproject.toml") as f:
# ret = re.findall(r'version = "(\d+\.\d+\.\d+)"', f.read())
# return ret[0]
return "0.3.1"
return "0.3.2"

View File

@@ -30,4 +30,5 @@ async def site(user_id=Depends(jwt_optional)):
model = child.url.split("/")[-1]
if not await check_has_permission(user, model):
site_copy.menus[index].children.remove(child)
site_copy.menus = list(filter(lambda x: x.children != [], site_copy.menus))
return site_copy.dict(by_alias=True, exclude_unset=True)