From 988801f3c0779aebd8ef7898a543f5253d2275b7 Mon Sep 17 00:00:00 2001 From: Muhammad Farhan <129956601+mfarhan943@users.noreply.github.com> Date: Tue, 4 Mar 2025 13:05:04 +0500 Subject: [PATCH] fix: handle AttributeError in exception clause (#36317) --- .../contentstore/xblock_storage_handlers/view_handlers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cms/djangoapps/contentstore/xblock_storage_handlers/view_handlers.py b/cms/djangoapps/contentstore/xblock_storage_handlers/view_handlers.py index 775f08e5fa..9a5efe70fc 100644 --- a/cms/djangoapps/contentstore/xblock_storage_handlers/view_handlers.py +++ b/cms/djangoapps/contentstore/xblock_storage_handlers/view_handlers.py @@ -1562,7 +1562,7 @@ def _get_release_date(xblock, user=None): reset_to_default = False try: reset_to_default = xblock.start.year < 1900 - except ValueError: + except (ValueError, AttributeError): # For old mongo courses, accessing the start attribute calls `to_json()`, # which raises a `ValueError` for years < 1900. reset_to_default = True