site contents
This commit is contained in:
@@ -272,7 +272,8 @@ def get_subscription_office():
|
|||||||
# @token_required
|
# @token_required
|
||||||
def get_web_contents():
|
def get_web_contents():
|
||||||
# Call the dashboard service
|
# Call the dashboard service
|
||||||
result = WebContentsService.get_web_contents_data()
|
provision_uid = request.args.get('provision_uid')
|
||||||
|
result = WebContentsService.get_web_contents_data(provision_uid)
|
||||||
return jsonify(result)
|
return jsonify(result)
|
||||||
|
|
||||||
#===================================================
|
#===================================================
|
||||||
|
|||||||
@@ -1,18 +1,20 @@
|
|||||||
from flask import jsonify
|
from flask import jsonify
|
||||||
|
|
||||||
|
from app.api.services import MyProductsService
|
||||||
from app.utils.logger import logger
|
from app.utils.logger import logger
|
||||||
from app.api.services.base_service import BaseService
|
from app.api.services.base_service import BaseService
|
||||||
from sqlalchemy import func, desc
|
from sqlalchemy import func, desc
|
||||||
from app.extensions import db
|
from app.extensions import db
|
||||||
|
from app.models import MembersProductsSettings
|
||||||
|
|
||||||
|
|
||||||
class WebContentsService(BaseService):
|
class WebContentsService(BaseService):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_web_contents_data():
|
def get_web_contents_data(provision_uid):
|
||||||
try:
|
try:
|
||||||
|
|
||||||
web_contents_data = {
|
web_contents_data = {
|
||||||
"site_title": "good-title",
|
"site_title": "my-site-title",
|
||||||
"site_description": "This is site description in the header",
|
"site_description": "This is site description in the header",
|
||||||
"site_logo_text": "MY-GOOD-LOGO",
|
"site_logo_text": "MY-GOOD-LOGO",
|
||||||
"site_contact_email": "email@specialemail.com",
|
"site_contact_email": "email@specialemail.com",
|
||||||
@@ -29,6 +31,12 @@ class WebContentsService(BaseService):
|
|||||||
"banner_description": "Mauris donec ociis magnis sapien ipsum sagittis sapien tempor and volute gravida aliquet quaerat vitae"
|
"banner_description": "Mauris donec ociis magnis sapien ipsum sagittis sapien tempor and volute gravida aliquet quaerat vitae"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
settings_data_result = MembersProductsSettings.get_product_settings_by_subscription_uid(provision_uid)
|
||||||
|
for t in settings_data_result:
|
||||||
|
if t.settings_key is web_contents_data:
|
||||||
|
web_contents_data[t.settings_key] = t.setting_value
|
||||||
|
else:
|
||||||
|
web_contents_data[t.settings_key] = t.setting_value
|
||||||
return web_contents_data
|
return web_contents_data
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
@@ -63,6 +63,14 @@ class MembersProducts(db.Model):
|
|||||||
return None
|
return None
|
||||||
return member_product
|
return member_product
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def get_member_product_by_subscription_uid(cls, subscription_uid):
|
||||||
|
member_product = cls.query.filter_by(subscription_uid=str(subscription_uid)).all()
|
||||||
|
if not member_product:
|
||||||
|
return None
|
||||||
|
return member_product
|
||||||
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def create_subscription(cls, member_id ,product_id,status,internal_url):
|
def create_subscription(cls, member_id ,product_id,status,internal_url):
|
||||||
# Create the subscription
|
# Create the subscription
|
||||||
|
|||||||
Reference in New Issue
Block a user