From 0c3e80320eb6d583cbfcc8a07a4b9d61af3d8a4c Mon Sep 17 00:00:00 2001 From: Ed Date: Mon, 8 May 2023 23:42:18 +0200 Subject: [PATCH] Fixes to carpooling function --- carpooling.py | 6 +++--- tpl/carpooling.html | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/carpooling.py b/carpooling.py index 34d45fc..50e48ba 100644 --- a/carpooling.py +++ b/carpooling.py @@ -36,13 +36,13 @@ async def carpooling_update(request, order: Order): error = "Offer or need form is not valid!" elif len(val) > 1000 and field == 'message': error = "The message cannot be longer than 1000 characters!" - elif val.count("\n") > 4: - error = "Please do not use more than 4 line breaks!" + elif val.count("\n") > 6: + error = "Please do not use more than 6 line breaks in the message!" else: payload[field] = val - order.carpooling_message = payload if not error: + order.carpooling_message = payload await order.edit_answer('carpooling_message', json.dumps(payload)) else: diff --git a/tpl/carpooling.html b/tpl/carpooling.html index 160d4e8..a51ec29 100644 --- a/tpl/carpooling.html +++ b/tpl/carpooling.html @@ -34,7 +34,7 @@