def notify_new_language(subproject, language, user):
 mails = []
 subscriptions = Profile.objects.subscribed_new_language(subproject.project, user)
 users = set()
 for subscription in subscriptions:
  mails.append(subscription.notify_new_language(subproject, language, user))
  users.add(subscription.user_id)
 for owner in subproject.project.owners.all():
  mails.append(owner.profile.notify_new_language(subproject, language, user))
 mails.append(get_notification_email(u'en', u'ADMINS', u'new_language', subproject, {u'language': language, u'user': user}, user=user))
 send_mails(mails)

def notify_new_language ( subproject , language , user ) : mails = [ ] subscriptions = Profile . objects . subscribed_new_language ( subproject . project , user ) users = set ( ) for subscription in subscriptions : mails . append ( subscription . notify_new_language ( subproject , language , user ) ) users . add ( subscription . user_id ) for owner in subproject . project . owners . all ( ) : mails . append ( owner . profile . notify_new_language ( subproject , language , user ) ) mails . append ( get_notification_email ( u'en' , u'ADMINS' , u'new_language' , subproject , { u'language' : language , u'user' : user } , user = user ) ) send_mails ( mails )
notify subscribed users about new language requests .