Fehler durch PRINTING_ACTIVE=False
Wenn PRINTING_ACTIVE = False
in der config genutzt wird, erhält man einen AttributeError wenn ein neuer Protokolltyp erstellt oder ein bestehender bearbeitet werden soll.
Traceback (most recent call last):
File "/home/magnus/proto/proto3/configproxy.py", line 971, in __getattr__
return self.data[key]
KeyError: 'PRINTING_PRINTERS'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/magnus/proto/proto3/venv/lib/python3.8/site-packages/flask/app.py", line 2088, in __call__
return self.wsgi_app(environ, start_response)
File "/home/magnus/proto/proto3/venv/lib/python3.8/site-packages/flask/app.py", line 2073, in wsgi_app
response = self.handle_exception(e)
File "/home/magnus/proto/proto3/venv/lib/python3.8/site-packages/flask/app.py", line 2070, in wsgi_app
response = self.full_dispatch_request()
File "/home/magnus/proto/proto3/venv/lib/python3.8/site-packages/flask/app.py", line 1515, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/magnus/proto/proto3/venv/lib/python3.8/site-packages/flask/app.py", line 1513, in full_dispatch_request
rv = self.dispatch_request()
File "/home/magnus/proto/proto3/venv/lib/python3.8/site-packages/flask/app.py", line 1499, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/home/magnus/proto/proto3/shared.py", line 156, in decorated_function
return function(*args, **kwargs)
File "/home/magnus/proto/proto3/server.py", line 413, in new_type
form = ProtocolTypeForm()
File "/home/magnus/proto/proto3/venv/lib/python3.8/site-packages/wtforms/form.py", line 208, in __call__
return type.__call__(cls, *args, **kwargs)
File "/home/magnus/proto/proto3/views/forms.py", line 185, in __init__
self.printer.choices = get_printer_choices()
File "/home/magnus/proto/proto3/views/forms.py", line 64, in get_printer_choices
if config.PRINTING_PRINTERS is not None:
File "/home/magnus/proto/proto3/configproxy.py", line 973, in __getattr__
raise AttributeError
Wahrscheinlich tritt der Fehler auf da get_printer_choices
in forms.py
prüft, ob config.PRINTING_PRINTERS is not None
aber config.PRINTING_PRINTERS
in diesem Fall gar nicht existiert.