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

1.9.0版本启动后对于没有权限的页面返回500错误 #1884

Closed
402309718 opened this issue Sep 28, 2022 · 2 comments · Fixed by #1896
Closed

1.9.0版本启动后对于没有权限的页面返回500错误 #1884

402309718 opened this issue Sep 28, 2022 · 2 comments · Fixed by #1896

Comments

@402309718
Copy link

重现步骤

1.启动1.9.0版本
2.新建非管理员用户test仅给与permission|菜单权限
3test用户尝试访问没有权限的页面
4.报错500
5.后台日志 File "/opt/venv4archery/lib/python3.9/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/opt/archery/common/utils/permission.py", line 14, in wrapper
if request.is_ajax():
AttributeError: 'WSGIRequest' object has no attribute 'is_ajax'
(看起来request.is_ajax函数不兼容了)

预期外的结果

报错500 internal error
应该提示
image

日志文本

No response

版本

1.9.0.

部署方式

Docker

是否还有其他可以辅助定位问题的信息?比如数据库版本等

@hhyo
Copy link
Owner

hhyo commented Sep 28, 2022

@402309718
Copy link
Author

我改了,但是不知道怎么提pr,求指导

@hhyo hhyo closed this as completed in #1896 Oct 7, 2022
hhyo added a commit that referenced this issue Oct 7, 2022
* 修复 is_ajax() 判断失效的问题 fix #1884

* 增加测试用例
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants