pfaffelh / mi-vvz

0 stars 0 forks source link

Save by pressing "New Module (and other?)" #2

Closed julianwiedermann closed 3 months ago

julianwiedermann commented 6 months ago

New Module (et al.) shouldn't be saved directly (and empty). Instead it should be saved when hitting "save" the first time.

pfaffelh commented 5 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.

Tobb2002 commented 5 months ago

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']}"
Tobb2002 commented 4 months ago

Für Anforderungskategorie kann das Problem noch nicht gelöst werden, da die edit Seite hier fehlt.

pfaffelh commented 3 months ago

Alles fertig.