From f022c2474ce8375b4cc1bd929a0f049f35e63d4f Mon Sep 17 00:00:00 2001 From: blitzmann Date: Mon, 8 May 2017 18:58:06 -0400 Subject: [PATCH] Restrict fit notes export to 400 character for CREST and XML export --- service/port.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/service/port.py b/service/port.py index 9f40e5cfc..c2329bfb5 100644 --- a/service/port.py +++ b/service/port.py @@ -409,7 +409,7 @@ class Port(object): # 2017/03/29 NOTE: "<" or "<" is Ignored # fit['description'] = "" % ofit.ID - fit['description'] = ofit.notes if ofit.notes is not None else "" + fit['description'] = ofit.notes[:397] + '...' if len(ofit.notes) > 400 else ofit.notes if ofit.notes is not None else "" fit['items'] = [] slotNum = {} @@ -1259,6 +1259,10 @@ class Port(object): # -- 170327 Ignored description -- try: notes = fit.notes # unicode + + if notes: + notes = notes[:397] + '...' if len(notes) > 400 else notes + description.setAttribute( "value", re.sub("(\r|\n|\r\n)+", "
", notes) if notes is not None else "" )