#NEWLINE# def check_notify_default( user_id , request ) : #NEWLINE# #INDENT# '\n    Check to see if the user is setup to receive notifications by default.\n\n    Arguments:\n        user_id - The ID of the user you want to find notification settings for\n        request - The HTTP request object\n    ' #NEWLINE# from raggregate.queries import user_preference as up #NEWLINE# prefs = up . get_user_prefs ( user_id ) #NEWLINE# if ( ( 'reg_for_notifications' in prefs ) and ( prefs [ 'reg_for_notifications' ] == 'on' ) ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( 'reg_for_notifications' not in user_id ) : #NEWLINE# #INDENT# if ( ( 'register_notify_by_default' in request . registry . settings ) and ( request . registry . settings [ 'register_notify_by_default' ] == 'true' ) ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# return False