inveniosoftware / invenio-accounts

Invenio module for managing user accounts.
https://invenio-accounts.readthedocs.io
MIT License
6 stars 67 forks source link

config: ensuring that the setting of ACCOUNTS_REGISTER_BLUEPRINT=Fals… #469

Closed psaiz closed 9 months ago

psaiz commented 9 months ago

…e works

:heart: Thank you for your contribution!

Description

Setting the parameter of ACCOUNTS_REGISTER_BLUEPRINT=False on opendata gave the following error:

172.19.0.1 - - [20/Dec/2023 09:02:07] "GET / HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/opt/invenio/var/instance/python/lib/python3.9/site-packages/flask/app.py", line 2552, in __call__
    return self.wsgi_app(environ, start_response)
  File "/opt/invenio/var/instance/python/lib/python3.9/site-packages/werkzeug/middleware/dispatcher.py", line 78, in __call__
    return app(environ, start_response)
  File "/opt/invenio/var/instance/python/lib/python3.9/site-packages/flask/app.py", line 2532, in wsgi_app
    response = self.handle_exception(e)
  File "/opt/invenio/var/instance/python/lib/python3.9/site-packages/flask/app.py", line 2529, in wsgi_app
    response = self.full_dispatch_request()
  File "/opt/invenio/var/instance/python/lib/python3.9/site-packages/flask/app.py", line 1815, in full_dispatch_request
    self.ensure_sync(func)()
  File "/opt/invenio/var/instance/python/lib/python3.9/site-packages/invenio_accounts/views/settings.py", line 83, in init_menu
    current_app.view_functions[view_name]
KeyError: 'security.change_password'

It looks like the initialization is sill requiring some settings that should not be needed. This patch addresses that issue.

psaiz commented 9 months ago

I've marked it as draft, since I can't get the new test to work correctly. Feedback on that will be appreciated

psaiz commented 9 months ago

Thanks for fixing the tests, Zach! Feel free to merge it at your best convenience