lazyflat/apply/utils.py
Moritz 69f2f1f635 lazyflat: combined alert + apply behind authenticated web UI
Three isolated services (alert scraper, apply HTTP worker, web UI+DB)
with argon2 auth, signed cookies, CSRF, rate-limited login, kill switch,
apply circuit breaker, audit log, and strict CSP.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 09:51:35 +02:00

12 lines
335 B
Python

import logging
logger = logging.getLogger("flat-apply")
def str_to_preview(string, max_length):
if not max_length > 3:
raise ValueError('max_length must be greater than 3')
first_line = string.split('\n')[0]
if len(first_line) > max_length:
return first_line[:max_length-3] + '...'
return first_line