Refactor: extract vCard generator to utils; make BASE_DIR configurable for tests; add unit and integration tests for vcard export; update app to use utils
This commit is contained in:
5
app.py
5
app.py
@@ -97,8 +97,9 @@ def index():
|
||||
|
||||
# vCard 4.0 erzeugen und speichern
|
||||
try:
|
||||
# generate vcard using helper
|
||||
generate_vcard(adresse, BASE_DIR)
|
||||
# determine base dir: prefer app.config, then app attribute, then module BASE_DIR
|
||||
base_dir = app.config.get('BASE_DIR') if app.config.get('BASE_DIR') else getattr(app, 'BASE_DIR', BASE_DIR)
|
||||
generate_vcard(adresse, base_dir)
|
||||
except Exception:
|
||||
# nicht kritisch: bei Fehlern nicht die ganze Anfrage abbrechen
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user