From 044e432eb772906527e0481a6d226f25237408a0 Mon Sep 17 00:00:00 2001 From: sys Date: Sat, 6 Nov 2021 17:22:05 +0000 Subject: [PATCH] update applications/common/admin.py. --- applications/common/admin.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/applications/common/admin.py b/applications/common/admin.py index 275e6de..403c983 100644 --- a/applications/common/admin.py +++ b/applications/common/admin.py @@ -60,6 +60,18 @@ def make_menu_tree(): for p0 in power0_dict: for p1 in power1_dict: + for p2 in power1_dict: + if p1.get('id') == p2.get('parent_id') and int(p2.get('type'))<2: + if p1.get("children") is None: + p1['children'] = [] + p1['children'].append(p2) + else: + hassame = 0 + for tmp in p1['children']: + if tmp.get('id') == p2.get('id'): + hassame =1 + if hassame == 0: + p1['children'].append(p2) if p0.get('id') == p1.get('parent_id'): if p0.get("children") is None: p0['children'] = [] -- Gitee