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.integrations import SimbrellaIntegration
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.helpers.response_helper import ResponseHelper
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'))
#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:
return {
"error": 'Duplicate url name',
@@ -252,11 +252,13 @@ class AccountService(BaseService):
profile_uid = current_profile.uid
profile_completed = member.profile_completed
else:
profle_result = MembersProfile.create_member_profile(member.id, practice, specialization,
profile_result = MembersProfile.create_member_profile(member.id, practice, specialization,
introduction,url_name)
if profle_result:
profile_uid = profle_result.uid
if profile_uid is not None and profile_uid != '':
if profile_result:
profile_uid = profile_result.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'])
result_data = {
+5 -5
View File
@@ -45,11 +45,11 @@ class MembersProfile(db.Model):
return member_profile
@classmethod
def get_member_product_by_url_name(cls, url_name):
member_product = cls.query.filter_by(url_name=str(url_name)).first()
if not member_product:
def get_any_member_profile_by_url_name(cls, url_name):
member_profile = cls.query.filter_by(url_name=str(url_name)).first()
if not member_profile:
return None
return member_product
return member_profile
@classmethod
@@ -70,7 +70,7 @@ class MembersProfile(db.Model):
(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(
uid=str(uuid.uuid4()),
member_id=member_id,