From ab7a369b6ed4ead465d5de3c0f57aadaa2efdfe8 Mon Sep 17 00:00:00 2001 From: AIIrondev Date: Mon, 17 Aug 2026 15:31:22 +0200 Subject: [PATCH] removal of automatic return of files --- Web/app.py | 65 +----------------------------------------------------- 1 file changed, 1 insertion(+), 64 deletions(-) diff --git a/Web/app.py b/Web/app.py index 23c76a4..26ff09f 100755 --- a/Web/app.py +++ b/Web/app.py @@ -72,9 +72,6 @@ try: redis = importlib.import_module('redis') except Exception: redis = None -# QR Code functionality deactivated -# import qrcode -# from qrcode.constants import ERROR_CORRECT_L import threading import shutil import uuid @@ -126,10 +123,6 @@ app.register_blueprint(terminplaner_bp, url_prefix='/terminplaner') if not os.path.exists(app.config['UPLOAD_FOLDER']): os.makedirs(app.config['UPLOAD_FOLDER'], exist_ok=True) -# QR Code directory creation deactivated -# if not os.path.exists(app.config['QR_CODE_FOLDER']): -# os.makedirs(app.config['QR_CODE_FOLDER']) - BACKUP_FOLDER = cfg.BACKUP_FOLDER if not os.path.exists(BACKUP_FOLDER): try: @@ -1486,7 +1479,7 @@ def update_appointment_statuses(): new_status = au.get_current_status(appointment, log_changes=True, user='scheduler') # Wenn sich der Status geändert hat, aktualisiere in der Datenbank - if new_status != old_status: + if new_status != old_status and not it.is_library_item(appointment.get('Item')): extra_fields = {} # --- Conflict resolver: planned → active transition --- @@ -7282,62 +7275,6 @@ def check_availability(): except Exception as e: return jsonify({'ok': False}), 500 - -# def create_qr_code(id): -# """ -# Generate a QR code for an item. -# The QR code contains a URL that points to the item details. -# -# Args: -# id (str): ID of the item to generate QR code for -# -# Returns: -# str: Filename of the generated QR code, or None if item not found -# """ -# qr = qrcode.QRCode( -# version=1, -# error_correction=ERROR_CORRECT_L, # Use imported constant -# box_size=10, -# border=4, -# ) -# -# # Parse and reconstruct the URL properly -# parsed_url = urlparse(request.url_root) -# -# # Force HTTPS if needed -# scheme = 'https' if parsed_url.scheme == 'http' else parsed_url.scheme -# -# # Properly reconstruct the base URL -# base_url = urlunparse((scheme, parsed_url.netloc, '', '', '', '')) -# -# # URL that will open this item directly -# item_url = f"{base_url}:{Port}/item/{id}" -# qr.add_data(item_url) -# qr.make(fit=True) -# -# item = it.get_item(id) -# if not item: -# return None -# -# img = qr.make_image(fill_color="black", back_color="white") -# -# # Create a unique filename using UUID -# unique_id = str(uuid.uuid4()) -# timestamp = time.strftime("%Y%m%d%H%M%S") -# -# # Still include the original name for readability but ensure uniqueness with UUID -# safe_name = secure_filename(item['Name']) -# filename = f"{safe_name}_{unique_id}_{timestamp}.png" -# qr_path = os.path.join(app.config['QR_CODE_FOLDER'], filename) -# -# -# # Fix the file handling - save to file object, not string -# with open(qr_path, 'wb') as f: -# img.save(f) -# -# return filename - -# Fix fromisoformat None value checks @app.route('/plan_booking', methods=['POST']) def plan_booking(): """