def check_file_contents_for_email_alerts(app):
 sa_session = app.model.context.current
 admin_users = app.config.get('admin_users', '').split(',')
 for repository in sa_session.query(app.model.Repository).filter((app.model.Repository.table.c.email_alerts != null())):
  email_alerts = json.loads(repository.email_alerts)
  for user_email in email_alerts:
   if (user_email in admin_users):
    return True
 return False

def check_file_contents_for_email_alerts ( app ) : sa_session = app . model . context . current admin_users = app . config . get ( 'admin_users' , '' ) . split ( ',' ) for repository in sa_session . query ( app . model . Repository ) . filter ( ( app . model . Repository . table . c . email_alerts != null ( ) ) ) : email_alerts = json . loads ( repository . email_alerts ) for user_email in email_alerts : if ( user_email in admin_users ) : return True return False
see if any admin users have chosen to receive email alerts when a repository is updated .