From b4a505c20b083e0e7093c8e7ba6995af84e9924d Mon Sep 17 00:00:00 2001 From: AIIrondev Date: Mon, 27 Jul 2026 15:09:26 +0200 Subject: [PATCH] changes to the borrow_record creation --- Web/app.py | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/Web/app.py b/Web/app.py index 0edd547..f0179cf 100755 --- a/Web/app.py +++ b/Web/app.py @@ -3605,27 +3605,23 @@ def api_item_detail(item_id): borrows_html = '' if borrow_records: rows = [] - count = 1 - for rec in borrow_records: - while count < 3: - user_raw = rec.get('User') - try: - user = decrypt_text(user_raw) if user_raw is not None else '' - except Exception: - user = user_raw - status = rec.get('Status', '') - start = fmt_dt(rec.get('Start')) - end = fmt_dt(rec.get('End')) - notes = html.escape(str(rec.get('Notes') or '')) - - rows.append( - f"
  • {html.escape(str(user or '-'))} — " - f"{html.escape(str(status))} — " - f"{html.escape(str(start))} → {html.escape(str(end))}" - f"{(' — ' + notes) if notes else ''}
  • " - ) - count += 1 + for rec in borrow_records[:3]: + user_raw = rec.get('User') + try: + user = decrypt_text(user_raw) if user_raw is not None else '' + except Exception: + user = user_raw + status = rec.get('Status', '') + start = fmt_dt(rec.get('Start')) + end = fmt_dt(rec.get('End')) + notes = html.escape(str(rec.get('Notes') or '')) + rows.append( + f"
  • {html.escape(str(user or '-'))} — " + f"{html.escape(str(status))} — " + f"{html.escape(str(start))} → {html.escape(str(end))}" + f"{(' — ' + notes) if notes else ''}
  • " + ) borrows_html = f"

    Ausleihhistorie

    " detail_html = f"""