Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

无ACTION按钮时出错 #128

Closed
JohnYan2017 opened this issue Jul 29, 2019 · 0 comments
Closed

无ACTION按钮时出错 #128

JohnYan2017 opened this issue Jul 29, 2019 · 0 comments
Labels
bug Something isn't working

Comments

@JohnYan2017
Copy link

bug描述
简单的描述下遇到的bug:
当使用权限设置不显示ACTION按钮时, 会出错

def custom_button(context):
admin = context.get('cl').model_admin
data = {}
actions = admin.get_actions(context.request)
# if hasattr(admin, 'actions'):
# actions = admin.actions
# 输出自定义按钮的属性
for name in actions:
values = {}
fun = actions.get(name)[0]
for key, v in fun.dict.items():
if key != 'len':
values[key] = v
data[name] = values
临时我增加了一个判断来解决
# 输出自定义按钮的属性
if not actions : return '{}'

环境

1.操作系统:
2.python版本:3.6
3.django版本:2.1
4.simpleui版本:2

@JohnYan2017 JohnYan2017 added the bug Something isn't working label Jul 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant