logout api and sonar

This commit is contained in:
jain
2023-07-11 22:34:59 +05:30
parent 7e7367e3a4
commit 18cb975d94
11 changed files with 51 additions and 16 deletions

View File

@ -93,7 +93,7 @@ class CreateJuniorSerializer(serializers.ModelSerializer):
"""Complete profile of the junior if below all data are filled"""
complete_profile_field = all([junior.phone, junior.gender, junior.country_name, junior.image,
junior.dob, junior.country_code, user.first_name, user.last_name,
user.email])
user.email, junior.passcode])
junior.is_complete_profile = False
if complete_profile_field:
junior.is_complete_profile = True
@ -224,12 +224,12 @@ class JuniorProfileSerializer(serializers.ModelSerializer):
def get_total_count(self, obj):
"""total fields count"""
return 9
return 10
def get_complete_field_count(self, obj):
"""total filled fields count"""
field_list = [obj.auth.first_name, obj.auth.last_name, obj.auth.email, obj.country_name, obj.country_code,
obj.phone, obj.gender, obj.dob, obj.image]
obj.phone, obj.gender, obj.dob, obj.image, obj.passcode]
complete_field = [data for data in field_list if data is not None and data != '']
return len(complete_field)
class Meta(object):