From 8f1b1418282e979329bd33bc5c3c239efa719d91 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Sat, 18 Nov 2023 19:27:05 +1100 Subject: [PATCH] feat: Remove slash from HNSChat name before saving --- main.py | 25 ++++++++++++++----------- sites/website.py | 2 +- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/main.py b/main.py index debe077..af10f2f 100644 --- a/main.py +++ b/main.py @@ -199,17 +199,20 @@ def send_edit(): # Json data data = db.get_website_data_raw(user['domain']) - data['data'] = request.form['data'] - data['HNS'] = request.form['hns'] - data['BTC'] = request.form['btc'] - data['ETH'] = request.form['eth'] - data['hnschat'] = request.form['hnschat'] - data['location'] = request.form['location'] - data['bg_colour'] = request.form['bg_colour'] - data['fg_colour'] = request.form['fg_colour'] - data['text_colour'] = request.form['text_colour'] - data['email'] = request.form['email'] - data['template'] = request.form['template'] + data['data'] = request.form['data'].strip() + data['HNS'] = request.form['hns'].strip() + data['BTC'] = request.form['btc'].strip() + data['ETH'] = request.form['eth'].strip() + data['hnschat'] = request.form['hnschat'].strip() + + data['hnschat'] = data['hnschat'].replace("/","").strip() + + data['location'] = request.form['location'].strip() + data['bg_colour'] = request.form['bg_colour'].strip() + data['fg_colour'] = request.form['fg_colour'].strip() + data['text_colour'] = request.form['text_colour'].strip() + data['email'] = request.form['email'].strip() + data['template'] = request.form['template'].strip() if 'hip2_display' in request.form: data['hip2_display'] = True diff --git a/sites/website.py b/sites/website.py index 6d56943..b36400d 100644 --- a/sites/website.py +++ b/sites/website.py @@ -74,7 +74,7 @@ def render(data,db_object): hide_addresses = True if hnschat != "": - hnschat = "" + hnschat + "" + hnschat = "" + hnschat + "/" if location != "": location = "" + location if email != "":