#NEWLINE# def get_users_messages( self ) : #NEWLINE# #INDENT# locations = SQLLocation . active_objects . filter ( domain = self . domain , location_type__administrative = False ) #NEWLINE# for sql_location in locations : #NEWLINE# #INDENT# in_charges = map ( CommCareUser . wrap , iter_docs ( CommCareUser . get_db ( ) , [ in_charge . user_id for in_charge in sql_location . facilityincharge_set . all ( ) ] ) ) #NEWLINE# web_users = [ web_user for web_user in get_web_users_by_location ( self . domain , sql_location . location_id ) if has_notifications_enabled ( self . domain , web_user ) ] #NEWLINE# ( message , kwargs ) = self . get_message_for_location ( sql_location . couch_location ) #NEWLINE# for user in ( web_users + in_charges ) : #NEWLINE# #INDENT# phone_number = get_preferred_phone_number_for_recipient ( user ) #NEWLINE# if ( not self ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# kwargs [ 'name' ] = user . full_name #NEWLINE# if message : #NEWLINE# #INDENT# ( yield ( user , phone_number , ( message % kwargs ) ) )