slight changes to the updating process to restart after such an event

This commit is contained in:
2026-07-05 11:40:06 +02:00
parent a8bce26eab
commit 9e3b54c1b1
3 changed files with 12 additions and 2 deletions
+8 -1
View File
@@ -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
+2 -1
View File
@@ -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,
+2
View File
@@ -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 "$@"