From c1a4184acd968b67094201073040e7fb8f2c7cae Mon Sep 17 00:00:00 2001 From: Gregory Martin Date: Mon, 5 Feb 2018 16:45:17 -0500 Subject: [PATCH] Swap out exception class --- cms/djangoapps/contentstore/views/videos.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cms/djangoapps/contentstore/views/videos.py b/cms/djangoapps/contentstore/views/videos.py index c36e95acde..d29ba6deb9 100644 --- a/cms/djangoapps/contentstore/views/videos.py +++ b/cms/djangoapps/contentstore/views/videos.py @@ -506,11 +506,8 @@ def convert_video_status(video): * `YouTube Duplicate` if status is `invalid_token` * user-friendly video status """ - try: - # Protect against legacy incomplete edx-val edx_video_id records. - now = datetime.now(video['created'].tzinfo) - except AttributeError: - now = datetime.now().replace(tzinfo=UTC) + now = datetime.now(video.get('created', datetime.now().replace(tzinfo=UTC)).tzinfo) + if video['status'] == 'upload' and (now - video['created']) > timedelta(hours=MAX_UPLOAD_HOURS): new_status = 'upload_failed' status = StatusDisplayStrings.get(new_status)