diff --git a/app/api/services/myproduct.py b/app/api/services/myproduct.py index 08f9f56..e5f2006 100644 --- a/app/api/services/myproduct.py +++ b/app/api/services/myproduct.py @@ -45,7 +45,7 @@ class MyProductsService(BaseService): member_data = Members.get_member_by_uid(uid) member_id = member_data.id - # is this a valid olor scheme + # is this a valid color scheme colorStyle= ProductsColorStyle.get_colorstyle_by_product_id_and_uid(product_id, color_style_uid) if colorStyle and colorStyle.color_style != '': MembersProducts.set_member_product_colorstyle(member_id, product_id, color_style_uid) diff --git a/app/api/services/web_contents.py b/app/api/services/web_contents.py index a65f0d3..265237d 100644 --- a/app/api/services/web_contents.py +++ b/app/api/services/web_contents.py @@ -6,7 +6,7 @@ from app.utils.logger import logger from app.api.services.base_service import BaseService from sqlalchemy import func, desc from app.extensions import db -from app.models import MembersProductsSettings, MembersProducts +from app.models import MembersProductsSettings, MembersProducts, ProductsColorStyle from threading import Thread class WebContentsService(BaseService): @@ -37,7 +37,34 @@ class WebContentsService(BaseService): "about_extra_2": "About - Extra 2 -Mauris donec ociis magnis sapien ipsum sagittis sapien tempor and volute gravida aliquet quaerat vitae ", "contact_title": "Questions? Let's Talk", "contact_introduction": "Want to learn more about us, or speak with an expert? Let us know what you are looking for and we’ll get back to you right away", + "internal_template_style": '' } + # web_contents_data[""] = "" + # Do we have this subsction + membersSubResult = MembersProducts.get_member_product_by_subscription_uid(provision_uid) + if membersSubResult: + member_sub = { + 'id': membersSubResult.id, + 'subscription_uid': str(membersSubResult.uid), + 'member_id': membersSubResult.member_id, + 'product_id': membersSubResult.product_id, + 'internal_url': membersSubResult.internal_url, + 'external_url': membersSubResult.external_url, + 'dns_group': membersSubResult.dns_group, + 'product_template': membersSubResult.product_template, + 'primary_server': membersSubResult.primary_server, + 'provision_port': membersSubResult.provision_port, + 'custom_template': membersSubResult.custom_template, + 'status': membersSubResult.status, + 'updated': membersSubResult.updated, + "added": membersSubResult.added, + } + + if membersSubResult.colorstyle !='': + # is this a valid olor scheme + colorStyle = ProductsColorStyle.get_colorstyle_by_product_id_and_uid(membersSubResult.product_id, membersSubResult.colorstyle) + if colorStyle and colorStyle.color_style != '': + web_contents_data["internal_template_style"] = colorStyle.color_style # web_contents_data ={} settings_data_result = MembersProductsSettings.get_product_settings_by_subscription_uid(provision_uid) @@ -48,6 +75,9 @@ class WebContentsService(BaseService): else: web_contents_data[t.settings_key.strip()] = t.setting_value.strip() + # The template set up + + return web_contents_data except Exception as e: