Closed julianwiedermann closed 3 months ago
Dazu müsste man beim Click auf editieren eines Moduls die Einträge im session_state zwischenspeichern, und auf den "..._edit"-Seiten die Einträge aus dem session_state wieder auslesen. Bei "Neues Modul" kann man dann den session_state entsprechend ändern, so dass die "..._edit"-Seite korrekt nach einem neuen Modul aussieht, obwohl es noch nicht gespeichert ist.
Beim speichern einer neuen Person ohne ändern des Namens kommt es zu dem folgenden Fehler:
TypeError: 'NoneType' object is not subscriptable
Traceback:
File "/home/tobi/.conda/envs/mathefaq/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 542, in _run_script
exec(code, module.__dict__)
File "/home/tobi/documents/studium/semester8/mathefaq/mi-vvz/pages/03_Personen_edit.py", line 90, in <module>
tools.update_confirm(collection, x, x_updated, )
File "/home/tobi/documents/studium/semester8/mathefaq/mi-vvz/misc/tools.py", line 48, in update_confirm
util.logger.info(f"User {st.session_state.user} hat in {util.collection_name[collection]} Item {repr(collection, x['_id'])} geändert.")
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/tobi/documents/studium/semester8/mathefaq/mi-vvz/misc/tools.py", line 327, in repr
res = f"{x['name']}, {x['name_prefix']}" if short else f"{x['name']}, {x['vorname']}"
Für Anforderungskategorie kann das Problem noch nicht gelöst werden, da die edit Seite hier fehlt.
Alles fertig.
New Module (et al.) shouldn't be saved directly (and empty). Instead it should be saved when hitting "save" the first time.