Skip to content

Commit

Permalink
feat!: code progress account mfe related changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad Faraz Maqsood authored and Muhammad Faraz Maqsood committed Oct 6, 2023
1 parent e8190cf commit f2f179a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
11 changes: 10 additions & 1 deletion lms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -4141,11 +4141,17 @@ def _make_locale_paths(settings): # pylint: disable=missing-function-docstring
'bio',
'course_certificates',
'country',
'city',
'region',
'date_joined',
'language_proficiencies',
"level_of_education",
'level_of_education',
'social_links',
'time_zone',
'english_language_level',
'employment_status',
'work_experience_level',
'job_title',

# Not an actual field, but used to signal whether badges should be public.
'accomplishments_shared',
Expand Down Expand Up @@ -4179,6 +4185,9 @@ def _make_locale_paths(settings): # pylint: disable=missing-function-docstring
"phone_number",
"activation_key",
"pending_name_change",
"national_id",
"date_of_birth",
"address_line",
]
)

Expand Down
21 changes: 20 additions & 1 deletion openedx/core/djangoapps/user_api/accounts/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,15 @@ def to_representation(self, user): # lint-amnesty, pylint: disable=arguments-di
"phone_number": None,
"pending_name_change": None,
"verified_name": None,
"national_id":None,
"date_of_birth": None,
"city": None,
"region": None,
"address_line": None,
"english_language_level": None,
"employment_status": None,
"work_experience_level": None,
"job_title": None,
}

if user_profile:
Expand Down Expand Up @@ -200,6 +209,15 @@ def to_representation(self, user): # lint-amnesty, pylint: disable=arguments-di
).data,
"extended_profile": get_extended_profile(user_profile),
"phone_number": user_profile.phone_number,
"national_id": AccountLegacyProfileSerializer.convert_empty_to_None(user_profile.national_id),
"date_of_birth": AccountLegacyProfileSerializer.convert_empty_to_None(user_profile.date_of_birth),
"city": AccountLegacyProfileSerializer.convert_empty_to_None(user_profile.city),
"region": AccountLegacyProfileSerializer.convert_empty_to_None(user_profile.region),
"address_line": AccountLegacyProfileSerializer.convert_empty_to_None(user_profile.address_line),
"english_language_level": AccountLegacyProfileSerializer.convert_empty_to_None(user_profile.english_language_level),
"employment_status": AccountLegacyProfileSerializer.convert_empty_to_None(user_profile.employment_status),
"work_experience_level": AccountLegacyProfileSerializer.convert_empty_to_None(user_profile.work_experience_level),
"job_title": AccountLegacyProfileSerializer.convert_empty_to_None(user_profile.job_title),
}
)

Expand Down Expand Up @@ -289,7 +307,8 @@ class Meta:
fields = (
"name", "gender", "goals", "year_of_birth", "level_of_education", "country", "state", "social_links",
"mailing_address", "bio", "profile_image", "requires_parental_consent", "language_proficiencies",
"phone_number", "city"
"phone_number", "city", "date_of_birth", "region", "city", "address_line", "english_language_level",
"employment_status", "work_experience_level", "job_title"
)
# Currently no read-only field, but keep this so view code doesn't need to know.
read_only_fields = ()
Expand Down

0 comments on commit f2f179a

Please sign in to comment.