fix url issues

This commit is contained in:
CHIEFSOFT\ameye
2025-09-22 13:09:33 -04:00
parent 1c6a29d36b
commit 500b4c5931
2 changed files with 13 additions and 11 deletions
+8 -6
View File
@@ -7,7 +7,7 @@ from marshmallow import ValidationError
from app.api.enums import TransactionType from app.api.enums import TransactionType
# from app.api.integrations import SimbrellaIntegration # from app.api.integrations import SimbrellaIntegration
from app.extensions import db from app.extensions import db
from app.models import Members, MembersActions, MembersProfile, Payments from app.models import Members, MembersActions, MembersProfile, Payments, MembersProducts
# from app.api.services.offer_analysis import OfferAnalysis # from app.api.services.offer_analysis import OfferAnalysis
from app.api.helpers.response_helper import ResponseHelper from app.api.helpers.response_helper import ResponseHelper
from werkzeug.security import generate_password_hash, check_password_hash from werkzeug.security import generate_password_hash, check_password_hash
@@ -223,7 +223,7 @@ class AccountService(BaseService):
url_name = str(validated_data.get('url_name')) url_name = str(validated_data.get('url_name'))
#verify is anybody is using this url name #verify is anybody is using this url name
urlNammeData = MembersProfile.get_member_product_by_url_name(url_name) urlNammeData = MembersProfile.get_any_member_profile_by_url_name(url_name)
if urlNammeData: if urlNammeData:
return { return {
"error": 'Duplicate url name', "error": 'Duplicate url name',
@@ -252,11 +252,13 @@ class AccountService(BaseService):
profile_uid = current_profile.uid profile_uid = current_profile.uid
profile_completed = member.profile_completed profile_completed = member.profile_completed
else: else:
profle_result = MembersProfile.create_member_profile(member.id, practice, specialization, profile_result = MembersProfile.create_member_profile(member.id, practice, specialization,
introduction,url_name) introduction,url_name)
if profle_result: if profile_result:
profile_uid = profle_result.uid profile_uid = profile_result.uid
if profile_uid is not None and profile_uid != '':
current_profile = MembersProfile.get_member_profile_by_member_id(member.id)
if profile_uid is not None and profile_uid != '' and current_profile is not None:
profile_completed = Members.set_member_profile_completed(member_data['uid']) profile_completed = Members.set_member_profile_completed(member_data['uid'])
result_data = { result_data = {
+5 -5
View File
@@ -45,11 +45,11 @@ class MembersProfile(db.Model):
return member_profile return member_profile
@classmethod @classmethod
def get_member_product_by_url_name(cls, url_name): def get_any_member_profile_by_url_name(cls, url_name):
member_product = cls.query.filter_by(url_name=str(url_name)).first() member_profile = cls.query.filter_by(url_name=str(url_name)).first()
if not member_product: if not member_profile:
return None return None
return member_product return member_profile
@classmethod @classmethod
@@ -70,7 +70,7 @@ class MembersProfile(db.Model):
(0 rows) (0 rows)
''' '''
logger.info(f" Data for Profile Data {member_id} ,{practice} ,{specialization}, {introduction} ") logger.info(f" Data for Profile Data {member_id} ,{practice} ,{specialization}, {introduction} {url_name} ")
profile_data = cls( profile_data = cls(
uid=str(uuid.uuid4()), uid=str(uuid.uuid4()),
member_id=member_id, member_id=member_id,