Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/djangoapps/student/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ def user_post_save_callback(sender, **kwargs):
'education': profile.level_of_education_display,
'address': profile.mailing_address,
'gender': profile.gender_display,
'country': str(profile.country),
'country': str(profile.country) if profile.country else '',
'is_marketable': False
}
# .. pii: Many pieces of PII are sent to Segment here. Retired directly through Segment API call in Tubular.
Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/courseware/views/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2234,7 +2234,7 @@ def financial_assistance_form(request, course_id=None):
'email': user.email,
'username': user.username,
'name': user.profile.name,
'country': str(user.profile.country.name),
'country': str(user.profile.country.name) if user.profile.country else '',
},
'submit_url': reverse(submit_url),
'fields': [
Expand Down
3 changes: 3 additions & 0 deletions lms/djangoapps/instructor_analytics/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ def _extract_attr(student, feature):
)
return None

if attr is None:
return ''

try:
DjangoJSONEncoder().default(attr)
return attr
Expand Down
5 changes: 1 addition & 4 deletions lms/djangoapps/instructor_analytics/tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,7 @@ def test_enrolled_students_features_keys(self):
def test_enrolled_student_with_no_country_city(self):
userreports = enrolled_students_features(self.course_key, ('username', 'city', 'country',))
for userreport in userreports:
# This behaviour is somewhat inconsistent: None string fields
# objects are converted to "None", but non-JSON serializable fields
# are converted to an empty string.
assert userreport['city'] == 'None'
assert userreport['city'] == ''
assert userreport['country'] == ''

def test_enrolled_students_meta_features_keys(self):
Expand Down
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/credit/api/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def create_credit_request(course_key, provider_id, username):
"user_mailing_address": "",
"user_country": (
user.profile.country.code
if user.profile.country.code is not None
if user.profile.country is not None
else ""
),
}
Expand Down
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/credit/tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def post(obj, create, extracted, **kwargs):
"user_email": user.email,
"user_full_name": user_profile.name,
"user_mailing_address": "",
"user_country": user_profile.country.code or "",
"user_country": user_profile.country.code if user_profile.country else "",
})

obj.save()
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/embargo/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def _get_user_country_from_profile(user: types.User) -> str:
profile_country = cache.get(cache_key)
if profile_country is None:
profile = getattr(user, 'profile', None)
if profile is not None and profile.country.code is not None:
if profile is not None and profile.country is not None:
profile_country = profile.country.code.upper()
else:
profile_country = ""
Expand Down
4 changes: 3 additions & 1 deletion openedx/core/djangoapps/user_api/accounts/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,9 @@ def to_representation(self, user): # pylint: disable=arguments-differ
data.update(
{
"bio": AccountLegacyProfileSerializer.convert_empty_to_None(user_profile.bio),
"country": AccountLegacyProfileSerializer.convert_empty_to_None(user_profile.country.code),
"country": AccountLegacyProfileSerializer.convert_empty_to_None(
user_profile.country.code if user_profile.country else ""
),
"state": AccountLegacyProfileSerializer.convert_empty_to_None(user_profile.state),
"profile_image": AccountLegacyProfileSerializer.get_profile_image(
user_profile, user, self.context.get('request')
Expand Down
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/user_authn/views/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def _track_user_registration(user, profile, params, third_party_provider, regist
'education': profile.level_of_education_display,
'address': profile.mailing_address,
'gender': profile.gender_display,
'country': str(profile.country),
'country': str(profile.country) if profile.country else '',
'is_marketable': is_marketable,
'anonymous_id': anonymous_id
}
Expand Down
6 changes: 3 additions & 3 deletions requirements/edx-sandbox/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ codejail-includes==2.0.0
# via -r requirements/edx-sandbox/base.in
contourpy==1.3.3
# via matplotlib
cryptography==48.0.0
cryptography==49.0.0
# via -r requirements/edx-sandbox/base.in
cycler==0.12.1
# via matplotlib
Expand All @@ -36,7 +36,7 @@ markupsafe==3.0.3
# via
# chem
# openedx-calc
matplotlib==3.10.9
matplotlib==3.11.0
# via -r requirements/edx-sandbox/base.in
mpmath==1.3.0
# via sympy
Expand Down Expand Up @@ -84,5 +84,5 @@ sympy==1.14.0
# via
# -r requirements/edx-sandbox/base.in
# openedx-calc
tqdm==4.68.1
tqdm==4.68.2
# via nltk
50 changes: 24 additions & 26 deletions requirements/edx/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ aniso8601==10.0.1
# tincan
annotated-types==0.7.0
# via pydantic
anyio==4.13.0
anyio==4.14.0
# via httpx
appdirs==1.4.4
# via fs
Expand Down Expand Up @@ -68,14 +68,14 @@ bleach[css]==6.4.0
# ora2
# xblock-drag-and-drop-v2
# xblock-poll
boto3==1.43.25
boto3==1.43.30
# via
# -r requirements/edx/kernel.in
# django-ses
# fs-s3fs
# ora2
# snowflake-connector-python
botocore==1.43.25
botocore==1.43.30
# via
# -r requirements/edx/kernel.in
# boto3
Expand Down Expand Up @@ -148,9 +148,9 @@ code-annotations==3.0.0
# edx-toggles
codejail-includes==2.0.0
# via -r requirements/edx/kernel.in
crowdsourcehinter-xblock==1.0.0
crowdsourcehinter-xblock==1.0.1
# via -r requirements/edx/bundled.in
cryptography==48.0.0
cryptography==49.0.0
# via
# -r requirements/edx/kernel.in
# django-fernet-fields-v2
Expand Down Expand Up @@ -268,7 +268,7 @@ django-config-models==3.0.0
# lti-consumer-xblock
django-cors-headers==4.9.0
# via -r requirements/edx/kernel.in
django-countries==8.2.0
django-countries==9.0.0
# via
# -r requirements/edx/kernel.in
# edx-enterprise
Expand Down Expand Up @@ -296,7 +296,7 @@ django-ipware==7.0.1
# -r requirements/edx/kernel.in
# edx-enterprise
# edx-proctoring
django-js-asset==3.1.2
django-js-asset==4.0.1
# via django-mptt
django-method-override==1.0.4
# via -r requirements/edx/kernel.in
Expand Down Expand Up @@ -515,6 +515,7 @@ edx-opaque-keys[django]==4.0.0
# openedx-events
# openedx-filters
# ora2
# xblock
# xblocks-contrib
edx-organizations==8.0.0
# via
Expand Down Expand Up @@ -589,7 +590,7 @@ event-tracking==4.0.2
# edx-search
fastavro==1.12.2
# via openedx-events
filelock==3.29.1
filelock==3.29.4
# via snowflake-connector-python
firebase-admin==7.4.0
# via edx-ace
Expand Down Expand Up @@ -618,7 +619,7 @@ google-api-core[grpc]==2.31.0
# google-cloud-core
# google-cloud-firestore
# google-cloud-storage
google-auth==2.53.0
google-auth==2.55.0
# via
# google-api-core
# google-cloud-core
Expand All @@ -630,7 +631,7 @@ google-cloud-core==2.6.0
# google-cloud-storage
google-cloud-firestore==2.27.0
# via firebase-admin
google-cloud-storage==3.11.0
google-cloud-storage==3.12.0
# via firebase-admin
google-crc32c==1.8.0
# via
Expand All @@ -642,12 +643,12 @@ googleapis-common-protos==1.75.0
# via
# google-api-core
# grpcio-status
grpcio==1.81.0
grpcio==1.81.1
# via
# google-api-core
# google-cloud-firestore
# grpcio-status
grpcio-status==1.81.0
grpcio-status==1.81.1
# via google-api-core
gunicorn==26.0.0
# via -r requirements/edx/kernel.in
Expand All @@ -672,7 +673,7 @@ httpx[http2]==0.28.1
# typesense
hyperframe==6.1.0
# via h2
icalendar==7.1.2
icalendar==7.1.3
# via -r requirements/edx/kernel.in
idna==3.18
# via
Expand Down Expand Up @@ -791,7 +792,7 @@ more-itertools==11.1.0
# via cssutils
mpmath==1.3.0
# via sympy
msgpack==1.1.2
msgpack==1.2.0
# via cachecontrol
multidict==6.7.1
# via
Expand Down Expand Up @@ -918,7 +919,7 @@ proto-plus==1.28.0
# via
# google-api-core
# google-cloud-firestore
protobuf==7.35.0
protobuf==7.35.1
# via
# google-api-core
# google-cloud-firestore
Expand Down Expand Up @@ -987,7 +988,7 @@ pynacl==1.6.2
# paramiko
pynliner==0.8.0
# via -r requirements/edx/kernel.in
pyopenssl==26.2.0
pyopenssl==26.3.0
# via snowflake-connector-python
pyparsing==3.3.2
# via
Expand Down Expand Up @@ -1182,7 +1183,7 @@ soupsieve==2.8.4
# via beautifulsoup4
sqlparse==0.5.5
# via django
staff-graded-xblock==4.0.0
staff-graded-xblock==4.0.1
# via -r requirements/edx/bundled.in
stevedore==5.8.0
# via
Expand All @@ -1196,7 +1197,7 @@ super-csv==5.0.0
# via edx-bulk-grades
sympy==1.14.0
# via openedx-calc
testfixtures==12.0.0
testfixtures==12.1.0
# via edx-enterprise
text-unidecode==1.3
# via python-slugify
Expand All @@ -1208,7 +1209,7 @@ tomlkit==0.15.0
# via
# openedx-core
# snowflake-connector-python
tqdm==4.68.1
tqdm==4.68.2
# via nltk
typesense==2.0.0
# via
Expand All @@ -1231,6 +1232,7 @@ typing-extensions==4.15.0
# pyopenssl
# referencing
# snowflake-connector-python
# testfixtures
# typesense
# typing-inspection
typing-inspection==0.4.2
Expand All @@ -1239,7 +1241,7 @@ tzdata==2026.2
# via
# icalendar
# kombu
tzlocal==5.3.1
tzlocal==5.4
# via celery
unicodecsv==0.14.1
# via
Expand Down Expand Up @@ -1273,12 +1275,8 @@ wcwidth==0.8.1
web-fragments==4.0.0
# via
# -r requirements/edx/kernel.in
# crowdsourcehinter-xblock
# edx-sga
# staff-graded-xblock
# xblock
# xblock-utils
# xblocks-contrib
webencodings==0.5.1
# via
# bleach
Expand All @@ -1295,7 +1293,7 @@ wrapt==2.2.1
# via
# -r requirements/edx/kernel.in
# xblocks-contrib
xblock[django]==6.1.0
xblock[django]==6.3.0
# via
# -r requirements/edx/kernel.in
# acid-xblock
Expand All @@ -1321,7 +1319,7 @@ xblock-utils==4.0.0
# via
# edx-sga
# xblock-poll
xblocks-contrib==0.16.1
xblocks-contrib==0.17.0
# via -r requirements/edx/bundled.in
xmlsec==1.3.14
# via
Expand Down
Loading
Loading