URL name
This commit is contained in:
@@ -5,4 +5,5 @@ class StartProfileSchema(Schema):
|
||||
uid = fields.Str(required=True)
|
||||
practice =fields.Str(required=True)
|
||||
specialization =fields.Str(required=True)
|
||||
introduction = fields.Str(required=True)
|
||||
introduction = fields.Str(required=True)
|
||||
url_name = fields.Str(required=True)
|
||||
|
||||
@@ -220,6 +220,18 @@ class AccountService(BaseService):
|
||||
practice = str(validated_data.get('practice'))
|
||||
specialization = str(validated_data.get('specialization'))
|
||||
introduction = str(validated_data.get('introduction'))
|
||||
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)
|
||||
if urlNammeData:
|
||||
save_error = {
|
||||
"error": 'Duplicate url name',
|
||||
"error_message": 'Try another url name',
|
||||
"url_name": url_name,
|
||||
}
|
||||
return ResponseHelper.error(data=save_error)
|
||||
|
||||
profile_uid = ''
|
||||
profile_completed = None
|
||||
member = Members.get_member_by_uid(uid)
|
||||
@@ -242,7 +254,7 @@ class AccountService(BaseService):
|
||||
profile_completed = member.profile_completed
|
||||
else:
|
||||
profle_result = MembersProfile.create_member_profile(member.id, practice, specialization,
|
||||
introduction)
|
||||
introduction,url_name)
|
||||
if profle_result:
|
||||
profile_uid = profle_result.uid
|
||||
if profile_uid is not None and profile_uid != '':
|
||||
|
||||
Reference in New Issue
Block a user