contact actions

This commit is contained in:
CHIEFSOFT\ameye
2026-05-14 12:15:28 -04:00
parent 41f61ce0c4
commit 74af6a2c5c
+5 -9
View File
@@ -2,7 +2,7 @@ from app.utils.logger import logger
from app.api.services.base_service import BaseService from app.api.services.base_service import BaseService
from marshmallow import ValidationError from marshmallow import ValidationError
from app.extensions import db from app.extensions import db
from app.models import MembersProducts, Products, Members from app.models import MembersProducts, Products, Members, ProductsContacts
from app.api.helpers.response_helper import ResponseHelper from app.api.helpers.response_helper import ResponseHelper
from app.api.schemas.user import UserSchema from app.api.schemas.user import UserSchema
@@ -34,7 +34,6 @@ class ContactService(BaseService):
cat_list = ['A000002', 'A000004', 'A000001', 'A000003'] cat_list = ['A000002', 'A000004', 'A000001', 'A000003']
dList = [] dList = []
sample_range = random.randint(20, 60) sample_range = random.randint(20, 60)
for x in range(sample_range): for x in range(sample_range):
@@ -94,15 +93,12 @@ class ContactService(BaseService):
title = data.get('title', '') title = data.get('title', '')
email = data.get('email', '') email = data.get('email', '')
sender = data.get('sender', '') sender = data.get('sender', '')
memSubb = MembersProducts.get_member_product_by_subscription_uid(subscription_uid) memSubb = MembersProducts.get_member_product_by_subscription_uid(subscription_uid)
if memSubb: if memSubb:
member_id = memSubb.member_id, member_id = memSubb.member_id,
product_id = memSubb.product_id product_id = memSubb.product_id
if message != '' and title != '' and email != '' and sender != '': if message != '' and title != '' and email != '' and sender != '':
logger.info(f"Ready to save data: {data}", exc_info=True) logger.info(f"Ready to save data: {data}", exc_info=True)
ProductsContacts.add_product_contact(
member_id, product_id, subscription_uid, title, email, sender, message
)