Skip to content

fix: fix timezone utc for 52#37199

Merged
UsamaSadiq merged 1 commit intoopenedx:masterfrom
mubbsharanwar:mubbsharanwar/issue-37151
Aug 13, 2025
Merged

fix: fix timezone utc for 52#37199
UsamaSadiq merged 1 commit intoopenedx:masterfrom
mubbsharanwar:mubbsharanwar/issue-37151

Conversation

@mubbsharanwar
Copy link
Contributor

@mubbsharanwar mubbsharanwar commented Aug 13, 2025

Description

This PR addresses compatibility with Django 5.0 and above.

In Django 5.0, django.utils.timezone.utc has been removed as noted in the official release notes. To ensure forward compatibility, particularly with the upcoming upgrade to Django 5.2, this PR replaces usage of timezone.utc with datetime.timezone.utc from Python’s standard library.

This change prevents AttributeError and ensures the codebase remains compatible with newer versions of Django.

Supporting information

Release Notes Link: https://docs.djangoproject.com/en/5.2/releases/5.0/#:~:text=django.utils.timezone.utc

Issue: 37151

The django.utils.timezone.utc is removed in Django 5.1.

issue: 37151
@mubbsharanwar mubbsharanwar requested a review from a team as a code owner August 13, 2025 12:11
Copy link
Member

@UsamaSadiq UsamaSadiq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to be merged.

@UsamaSadiq UsamaSadiq merged commit b52e72f into openedx:master Aug 13, 2025
49 checks passed
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

salman2013 pushed a commit to salman2013/edx-platform that referenced this pull request Sep 10, 2025
The django.utils.timezone.utc is removed in Django 5.1.

issue: 37151
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants