From df0b983ea3cac91e5cfd36065d7da5f93822f2fc Mon Sep 17 00:00:00 2001 From: Mushtaq Ali Date: Fri, 12 Feb 2016 17:31:00 +0500 Subject: [PATCH] Improve is_self_paced method --- cms/djangoapps/contentstore/utils.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/cms/djangoapps/contentstore/utils.py b/cms/djangoapps/contentstore/utils.py index d17ab74393..9c10a00516 100644 --- a/cms/djangoapps/contentstore/utils.py +++ b/cms/djangoapps/contentstore/utils.py @@ -463,10 +463,4 @@ def is_self_paced(course): """ Returns True if course is self-paced, False otherwise. """ - if course: - try: - return course.self_paced and SelfPacedConfiguration.current().enabled - except AttributeError: - # if course object has no self_paced attribute - pass - return False + return course.self_paced and SelfPacedConfiguration.current().enabled if course else False