From 732d584c85e952e1cec7f279f948da24eb3d1adf Mon Sep 17 00:00:00 2001 From: chrisjsimpson Date: Fri, 2 Apr 2021 14:11:37 +0100 Subject: [PATCH 1/6] remove unused couchdb method --- __init__.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/__init__.py b/__init__.py index 48e444b..051bc71 100644 --- a/__init__.py +++ b/__init__.py @@ -48,24 +48,6 @@ def getConfig(name=None): return False -def get_couchdb_url(): - couch_con_url = "".join( - [ - getConfig("COUCHDB_SCHEME"), - getConfig("COUCHDB_USER"), - ":", - getConfig("COUCHDB_PASSWORD"), - "@", - getConfig("COUCHDB_IP"), - ":", - str(getConfig("COUCHDB_PORT")), - "/", - getConfig("COUCHDB_DBNAME"), - ] - ) - return couch_con_url - - def getLatestCouchDBRevision(host, docid): req = requests.get(host + "/" + docid) resp = json.loads(req.text) From 4ae8e86f3a1d7a1b977c89d882d9b384353b803c Mon Sep 17 00:00:00 2001 From: chrisjsimpson Date: Fri, 2 Apr 2021 14:13:08 +0100 Subject: [PATCH 2/6] remove unused module logic --- __init__.py | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/__init__.py b/__init__.py index 051bc71..b37a9e6 100644 --- a/__init__.py +++ b/__init__.py @@ -69,25 +69,6 @@ def save_plans(): payload = {} form = SignupForm() payload["version"] = 1 - payload["modules_path"] = "../../../" - payload["modules"] = [ - { - "name": "module_seo_page_title", - "src": "https://github.com/Subscribie/module-seo-page-title.git", - }, - { - "name": "module_iframe_embed", - "src": "https://github.com/Subscribie/module-iframe-embed.git", - }, - { - "name": "module_style_shop", - "src": "https://github.com/Subscribie/module-style-shop.git", - }, - { - "name": "module_pages", - "src": "https://github.com/Subscribie/module-pages.git", - }, - ] payload["users"] = [form.email.data] session["email"] = form.email.data payload["password"] = form.password.data From 073633ce5ca0c193a9d5e50354fe5789f63b838e Mon Sep 17 00:00:00 2001 From: chrisjsimpson Date: Fri, 2 Apr 2021 14:14:18 +0100 Subject: [PATCH 3/6] remove unused couchdb method --- __init__.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/__init__.py b/__init__.py index b37a9e6..07c1ed0 100644 --- a/__init__.py +++ b/__init__.py @@ -48,16 +48,6 @@ def getConfig(name=None): return False -def getLatestCouchDBRevision(host, docid): - req = requests.get(host + "/" + docid) - resp = json.loads(req.text) - if "_rev" in resp: - revisionId = resp["_rev"] - else: - revisionId = None - return revisionId - - @builder.route("/start-building", methods=["GET"]) def start_building(): form = SignupForm() From 36b6afe82d0e93a6d3765802c117fecfa3e40cc0 Mon Sep 17 00:00:00 2001 From: chrisjsimpson Date: Fri, 2 Apr 2021 15:04:24 +0100 Subject: [PATCH 4/6] store description during site creation --- __init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__init__.py b/__init__.py index 07c1ed0..5543b0f 100644 --- a/__init__.py +++ b/__init__.py @@ -92,7 +92,7 @@ def save_plans(): getPlan(form.interval_amount.data, index) * 100 ) # noqa: E501 plan["interval_unit"] = getPlan(form.interval_unit.data, index) - plan["selling_points"] = getPlan(form.selling_points.data, index) + plan["description"] = request.form.get("description", "") plan["subscription_terms"] = {"minimum_term_months": 12} plan["primary_colour"] = "#e73b1a" # Plan requirements From dfef5cf2b1f3feddbb123b33c31f2147966fb10c Mon Sep 17 00:00:00 2001 From: chrisjsimpson Date: Tue, 9 Nov 2021 23:57:46 +0000 Subject: [PATCH 5/6] wip #18 skip payment step, go straight into product --- __init__.py | 7 +++---- forms.py | 8 ++------ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/__init__.py b/__init__.py index 5543b0f..6dcf353 100644 --- a/__init__.py +++ b/__init__.py @@ -117,8 +117,6 @@ def save_plans(): with open(subdomain + ".json", "w") as fp: fp.write(json.dumps(payload)) deployJamla(subdomain + ".json") - # Redirect to activation page - url = "https://" + request.host + "/activate/" + subdomain # Inform try: @@ -127,7 +125,7 @@ def save_plans(): new_site_url = session["site-url"] task_queue.put( lambda: requests.get( - f"https://api.telegram.org/bot{token}/sendMessage?chat_id={chat_id}&text=NewShop%20{new_site_url}" + f"https://api.telegram.org/bot{token}/sendMessage?chat_id={chat_id}&text=NewShop%20{new_site_url}" # noqa ) ) except Exception: @@ -139,7 +137,8 @@ def save_plans(): con.execute(query, (session["site-url"], session["email"].lower())) con.commit() - return redirect(url) + # Redirect to their site + return redirect(session["site-url"]) @builder.route("/activate/") diff --git a/forms.py b/forms.py index 9d186b1..e6085e9 100644 --- a/forms.py +++ b/forms.py @@ -64,10 +64,6 @@ class SignupForm(StripWhitespaceForm): interval_unit = FieldList( StringField("Interval Unit", [validators.optional()]), min_entries=1 ) - selling_points = FieldList( - FieldList( - StringField("Unique Selling Point", [validators.DataRequired()]), - min_entries=3, - ), - min_entries=1, + description = FieldList( + StringField("Interval Unit", [validators.optional()]), min_entries=1 ) From a42bceb0cf17f0766a417a677eb8c3b2dff22dfb Mon Sep 17 00:00:00 2001 From: chrisjsimpson Date: Wed, 10 Nov 2021 00:05:02 +0000 Subject: [PATCH 6/6] #18 crude wait for uwsgi to be ready --- __init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/__init__.py b/__init__.py index 6dcf353..3951324 100644 --- a/__init__.py +++ b/__init__.py @@ -137,6 +137,9 @@ def save_plans(): con.execute(query, (session["site-url"], session["email"].lower())) con.commit() + from time import sleep + + sleep(3) # Redirect to their site return redirect(session["site-url"])