Flask-AppBuilder
Flask-AppBuilder copied to clipboard
KeyError: 'view_menu' error in security_cleanup
If you'd like to report a bug in Flask-Appbuilder, fill out the template below. Provide any extra information that may be useful
Environment
refer to https://github.com/dpgaspar/Flask-AppBuilder/issues/315
bug trace back
2020-03-15 12:03:50,130:DEBUG:flask_appbuilder.security.manager:State transitions: {'add': {}, 'del_role_pvm': set(), 'del_views': set(), 'del_perms': set()} Traceback (most recent call last): File "C:\Python37\lib\site-packages\bson\dbref.py", line 83, in getattr return self.__kwargs[key] KeyError: 'view_menu'
only way to solve this probles is reset user sole db.
Flask-Appbuilder version: latest
pip freeze output:
Describe the expected results
Tell us what should happen.
Paste a minimal example that causes the problem.
Describe the actual results
Tell us what happens instead.
Paste the full traceback if there was an exception.
Steps to reproduce
finally i got steps to trigger this bug: 1.add an action abc to your view 2.run your webapp---- action's permission will insert into your db 3.remove you aciton abc code from view 4. run you webapp
`2020-03-15 12:03:50,130:DEBUG:flask_appbuilder.security.manager:State transitions: {'add': {}, 'del_role_pvm': set(), 'del_views': set(), 'del_perms': set()} Traceback (most recent call last): File "C:\Python37\lib\site-packages\bson\dbref.py", line 83, in getattr return self.__kwargs[key] KeyError: 'view_menu'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "F:/win7_d/other_project/Host17098401336/HostcrackerWeb_dev/run.py", line 1, in from app import app File "F:\win7_d\other_project\Host17098401336\HostcrackerWeb_dev\app_init_.py", line 17, in from app import views File "F:\win7_d\other_project\Host17098401336\HostcrackerWeb_dev\app\views.py", line 382, in appbuilder.security_cleanup() File "F:\win7_d\other_project\Host17098401336\HostcrackerWeb_dev\flask_appbuilder\base.py", line 539, in security_cleanup self.sm.security_cleanup(self.baseviews, self.menu) File "F:\win7_d\other_project\Host17098401336\HostcrackerWeb_dev\flask_appbuilder\security\manager.py", line 1245, in security_cleanup self.security_converge(baseviews, menus) File "F:\win7_d\other_project\Host17098401336\HostcrackerWeb_dev\flask_appbuilder\security\manager.py", line 1392, in security_converge (pvm.view_menu.name, pvm.permission.name) File "C:\Python37\lib\site-packages\bson\dbref.py", line 85, in getattr raise AttributeError(key) AttributeError: view_menu