From 9e3b54c1b15ebb0a67d19d7c35c8e872aebb77c5 Mon Sep 17 00:00:00 2001 From: Aiirondev Date: Sun, 5 Jul 2026 11:40:06 +0200 Subject: [PATCH 1/4] slight changes to the updating process to restart after such an event --- Web/app.py | 9 ++++++++- Web/modules/database/items.py | 3 ++- update.sh | 2 ++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Web/app.py b/Web/app.py index 4409819..33ded74 100755 --- a/Web/app.py +++ b/Web/app.py @@ -2477,6 +2477,7 @@ def _upload_excel_items(scope='inventory'): parent_item_id=parent_item_id, isbn=row['isbn'], item_type=row['item_type'], + is_library=False ) if not item_id: import_errors.append((row['row_number'], 'Fehler beim Anlegen des Artikels')) @@ -5133,6 +5134,8 @@ def upload_item(): if 'username' not in session: return jsonify({'success': False, 'message': 'Nicht angemeldet'}), 401 + item_is_library = False + # Check if user may insert items username = session['username'] permissions = _get_current_user_permissions() or us.build_default_permission_payload('standard_user') @@ -5177,6 +5180,9 @@ def upload_item(): item_type_input = sanitize_form_value(request.form.get('item_type_input', '')) library_category = sanitize_form_value(request.form.get('library_category', '')) + if library_caregory != '': + item_is_library = True + try: item_count = int(item_count_raw) if item_count_raw else 1 except (TypeError, ValueError): @@ -6063,7 +6069,8 @@ def upload_item(): parent_item_id=parent_item_id, isbn=item_isbn, item_type=item_type, - library_category=library_category + library_category=library_category, + is_library=item_is_library ) if not item_id: break diff --git a/Web/modules/database/items.py b/Web/modules/database/items.py index 65ba4e5..ff497e3 100755 --- a/Web/modules/database/items.py +++ b/Web/modules/database/items.py @@ -49,7 +49,7 @@ def add_item(name, ort, beschreibung, images=None, filter=None, filter2=None, fi ansch_jahr=None, ansch_kost=None, code_4=None, reservierbar=True, series_group_id=None, series_count=1, series_position=1, is_grouped_sub_item=False, parent_item_id=None, - isbn=None, item_type='general', library_category=None): + isbn=None, item_type='general', library_category=None, is_library=False): """ Add a new item to the inventory. @@ -102,6 +102,7 @@ def add_item(name, ort, beschreibung, images=None, filter=None, filter2=None, fi 'ISBN': isbn, 'library_category': library_category, 'ItemType': item_type, + 'is_library': is_library, 'SeriesGroupId': series_group_id, 'SeriesCount': series_count, 'SeriesPosition': series_position, diff --git a/update.sh b/update.sh index 3f6db6a..8953032 100755 --- a/update.sh +++ b/update.sh @@ -621,6 +621,8 @@ EOF cleanup_old_dist_artifacts cleanup_docker_dangling_images log_message "Update completed successfully to release $latest_tag" + + sudo ./opt/Inventarsystem/restart.sh } main "$@" From 613c1e11e4c462f9dcafc74027b63b7f836c06e4 Mon Sep 17 00:00:00 2001 From: Aiirondev Date: Sun, 5 Jul 2026 11:46:30 +0200 Subject: [PATCH 2/4] slight changes of important kexy filters for the retrival of Library Items --- Web/modules/database/items.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Web/modules/database/items.py b/Web/modules/database/items.py index ff497e3..a4e8bc5 100755 --- a/Web/modules/database/items.py +++ b/Web/modules/database/items.py @@ -24,7 +24,7 @@ import Web.modules.database.settings as cfg from Web.modules.database.settings import MongoClient -LIBRARY_ITEM_TYPES = ('book', 'cd', 'dvd', 'other', 'schoolbook') +LIBRARY_ITEM_TYPES = ('book', 'cd', 'dvd', 'other', 'schoolbook', 'Buch', 'Schulbuch', 'schulbuch') def _non_library_query(extra_query=None): From 5f5784e7c31ef1f918f65dc4cb5e26dc47cfa3c5 Mon Sep 17 00:00:00 2001 From: Aiirondev Date: Sun, 5 Jul 2026 11:52:57 +0200 Subject: [PATCH 3/4] addition of a debuging step --- update.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/update.sh b/update.sh index 8953032..6909d1e 100755 --- a/update.sh +++ b/update.sh @@ -623,6 +623,7 @@ EOF log_message "Update completed successfully to release $latest_tag" sudo ./opt/Inventarsystem/restart.sh + echo "Restart of the Server Completet" } main "$@" From 7fd27e8c02ab5549591dfa2d1b5d15efc21afed4 Mon Sep 17 00:00:00 2001 From: Aiirondev Date: Sun, 5 Jul 2026 12:02:57 +0200 Subject: [PATCH 4/4] additional changes to account for legacy Item Types --- Web/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Web/app.py b/Web/app.py index 33ded74..3a105f4 100755 --- a/Web/app.py +++ b/Web/app.py @@ -289,7 +289,7 @@ SCHEDULER_INTERVAL = cfg.SCHEDULER_INTERVAL_MIN SSL_CERT = cfg.SSL_CERT SSL_KEY = cfg.SSL_KEY -LIBRARY_ITEM_TYPES = ['book', 'cd', 'dvd', 'other', 'schoolbook'] +LIBRARY_ITEM_TYPES = ('book', 'cd', 'dvd', 'other', 'schoolbook', 'Buch', 'Schulbuch', 'schulbuch') INVOICE_CURRENCY = 'EUR' NOTIFICATION_STATUS_CACHE_TTL = max(3, int(os.getenv('INVENTAR_NOTIFICATION_STATUS_CACHE_TTL', '8'))) @@ -3212,7 +3212,7 @@ def api_library_items(): ausleihungen_db = db['ausleihungen'] query = { - 'ItemType': {'$in': ['book', 'cd', 'dvd', 'other', 'schoolbook']}, + 'ItemType': {'$in': ['book', 'cd', 'dvd', 'other', 'schoolbook', 'schulbuch', 'Buch', 'Schulbuch']}, 'IsGroupedSubItem': {'$ne': True}, 'Deleted': {'$ne': True} }