def in_preview_mode():
 hostname = get_current_request_hostname()
 preview_lms_base = settings.FEATURES.get('PREVIEW_LMS_BASE', None)
 return bool((preview_lms_base and hostname and (hostname.split(':')[0] == preview_lms_base.split(':')[0])))

def in_preview_mode ( ) : hostname = get_current_request_hostname ( ) preview_lms_base = settings . FEATURES . get ( 'PREVIEW_LMS_BASE' , None ) return bool ( ( preview_lms_base and hostname and ( hostname . split ( ':' ) [ 0 ] == preview_lms_base . split ( ':' ) [ 0 ] ) ) )
returns whether the user is in preview mode or not .