Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix configuration without authentication
If an empty password was configured in the user interface configuration, instead of requiring no authentication, pyCA would throw an internal server error: ``` Traceback (most recent call last): File "/usr/lib/python3.11/site-packages/flask/app.py", line 2528, in wsgi_app response = self.full_dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/flask/app.py", line 1825, in full_dispatch_request rv = self.handle_user_exception(e) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/flask/app.py", line 1823, in full_dispatch_request rv = self.dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/flask/app.py", line 1799, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/lars/dev/opencast/pyCA/pyca/ui/utils.py", line 16, in decorated or auth.username != config('ui', 'username') \ ^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'username' ``` This patch fixes the issue.
- Loading branch information