mirror of
https://github.com/fastapi-admin/fastapi-admin.git
synced 2026-03-13 10:32:25 +08:00
Hide menu when no children menu.
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user