def new_public_project(email):
 from website.models import Node
 node = Node.load(email.data['nid'])
 if (not node):
  return False
 public = email.find_sent_of_same_type_and_user()
 return (node.is_public and (not len(public)))

def new_public_project ( email ) : from website . models import Node node = Node . load ( email . data [ 'nid' ] ) if ( not node ) : return False public = email . find_sent_of_same_type_and_user ( ) return ( node . is_public and ( not len ( public ) ) )
will check to make sure the project that triggered this presend is still public before sending the email .