changes to the borrow_record creation
This commit is contained in:
+1
-5
@@ -3605,10 +3605,8 @@ def api_item_detail(item_id):
|
|||||||
borrows_html = ''
|
borrows_html = ''
|
||||||
if borrow_records:
|
if borrow_records:
|
||||||
rows = []
|
rows = []
|
||||||
count = 1
|
|
||||||
|
|
||||||
for rec in borrow_records:
|
for rec in borrow_records[:3]:
|
||||||
while count < 3:
|
|
||||||
user_raw = rec.get('User')
|
user_raw = rec.get('User')
|
||||||
try:
|
try:
|
||||||
user = decrypt_text(user_raw) if user_raw is not None else ''
|
user = decrypt_text(user_raw) if user_raw is not None else ''
|
||||||
@@ -3618,14 +3616,12 @@ def api_item_detail(item_id):
|
|||||||
start = fmt_dt(rec.get('Start'))
|
start = fmt_dt(rec.get('Start'))
|
||||||
end = fmt_dt(rec.get('End'))
|
end = fmt_dt(rec.get('End'))
|
||||||
notes = html.escape(str(rec.get('Notes') or ''))
|
notes = html.escape(str(rec.get('Notes') or ''))
|
||||||
|
|
||||||
rows.append(
|
rows.append(
|
||||||
f"<li><strong>{html.escape(str(user or '-'))}</strong> — "
|
f"<li><strong>{html.escape(str(user or '-'))}</strong> — "
|
||||||
f"{html.escape(str(status))} — "
|
f"{html.escape(str(status))} — "
|
||||||
f"{html.escape(str(start))} → {html.escape(str(end))}"
|
f"{html.escape(str(start))} → {html.escape(str(end))}"
|
||||||
f"{(' — ' + notes) if notes else ''}</li>"
|
f"{(' — ' + notes) if notes else ''}</li>"
|
||||||
)
|
)
|
||||||
count += 1
|
|
||||||
borrows_html = f"<h3>Ausleihhistorie</h3><ul>{''.join(rows)}</ul>"
|
borrows_html = f"<h3>Ausleihhistorie</h3><ul>{''.join(rows)}</ul>"
|
||||||
|
|
||||||
detail_html = f"""
|
detail_html = f"""
|
||||||
|
|||||||
Reference in New Issue
Block a user