Skip to content

Fix AttributeError: django.utils.timezone has no attribute 'utc' in podcast details - #228

Merged
dannyvfilms merged 1 commit into
dannyvfilms:latestfrom
nakenyon:fix/timezone-utc-podcast-details
Jun 4, 2026
Merged

Fix AttributeError: django.utils.timezone has no attribute 'utc' in podcast details#228
dannyvfilms merged 1 commit into
dannyvfilms:latestfrom
nakenyon:fix/timezone-utc-podcast-details

Conversation

@nakenyon

@nakenyon nakenyon commented Jun 3, 2026

Copy link
Copy Markdown

Summary

  • media_details_views.py line 426 used timezone.utc expecting Python's datetime.timezone, but timezone in that module's scope is django.utils.timezone (imported at the top of the file), which has no .utc attribute
  • Fixed by importing timezone as dt_timezone from datetime alongside the existing datetime import inside the podcast details block, and using dt_timezone.utc for the epoch fallback value in the Coalesce annotation

Traceback

AttributeError: module 'django.utils.timezone' has no attribute 'utc'
  File "/yamtrack/app/media_details_views.py", line 426, in media_details
    Value(datetime(1970, 1, 1, tzinfo=timezone.utc),

Test plan

  • Navigate to /details/pocketcasts/podcast/<id>/<slug> — should load without 500 error
  • Confirm podcast episode list renders ordered by published date (newest first), with undated episodes at the end

🤖 Generated with Claude Code

….timezone.utc in podcast details

django.utils.timezone has no .utc attribute; use Python's built-in
datetime.timezone.utc for the epoch fallback value in the Coalesce
annotation on podcast episode ordering.

Closes #(no issue — 500 error on /details/pocketcasts/podcast/ paths)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@nakenyon
nakenyon force-pushed the fix/timezone-utc-podcast-details branch from 07ad1ec to 054235c Compare June 3, 2026 15:31
@nakenyon
nakenyon marked this pull request as ready for review June 3, 2026 15:32
@dannyvfilms
dannyvfilms merged commit 12e3d5e into dannyvfilms:latest Jun 4, 2026
1 of 2 checks passed
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.

2 participants