Fixes in flash and lang
This commit is contained in:
parent
f185be25a8
commit
921022cf98
5 changed files with 21 additions and 14 deletions
|
|
@ -189,15 +189,15 @@ def check_login_admin(session={}):
|
|||
with db.query('select module from privilegesmodule2 WHERE user_id=%s', [result['id']]) as cursor:
|
||||
modules_priv=[v['module'] for v in cursor.fetchall()]
|
||||
|
||||
for v in modules_admin:
|
||||
if v[0] in modules_priv:
|
||||
for k, v in modules_admin.items():
|
||||
if k in modules_priv:
|
||||
if len(v)>2:
|
||||
modules_priv+=v[2]
|
||||
else:
|
||||
|
||||
modules_priv=[]
|
||||
for v in modules_admin:
|
||||
modules_priv.append(v[0])
|
||||
for k, v in modules_admin.items():
|
||||
modules_priv.append(k)
|
||||
if len(v)==3:
|
||||
modules_priv+=v[2]
|
||||
|
||||
|
|
|
|||
|
|
@ -113,7 +113,14 @@ def admin_permissions(user_id, session={}):
|
|||
|
||||
priv.fields['module'].name_form=SelectForm
|
||||
|
||||
arr_modules={k:v[0] for k, v in modules_admin.items()}
|
||||
#arr_modules={k:v[0] for k, v in modules_admin.items()}
|
||||
arr_modules={}
|
||||
|
||||
for k, v in modules_admin.items():
|
||||
if type(v[0]).__name__=='function':
|
||||
arr_modules[k]=v[0]()
|
||||
else:
|
||||
arr_modules[k]=v[0]
|
||||
|
||||
priv.fields['user_id'].name_form=HiddenForm
|
||||
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ lang_selected=session['lang']
|
|||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
|
||||
${show_flash_message()|n}
|
||||
<%block name="content">
|
||||
</%block>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue