def notify_merge_failure(subproject, error, status):
 subscriptions = Profile.objects.subscribed_merge_failure(subproject.project)
 users = set()
 mails = []
 for subscription in subscriptions:
  mails.append(subscription.notify_merge_failure(subproject, error, status))
  users.add(subscription.user_id)
 for owner in subproject.project.owners.all():
  mails.append(owner.profile.notify_merge_failure(subproject, error, status))
 mails.append(get_notification_email(u'en', u'ADMINS', u'merge_failure', subproject, {u'subproject': subproject, u'status': status, u'error': error}))
 send_mails(mails)

def notify_merge_failure ( subproject , error , status ) : subscriptions = Profile . objects . subscribed_merge_failure ( subproject . project ) users = set ( ) mails = [ ] for subscription in subscriptions : mails . append ( subscription . notify_merge_failure ( subproject , error , status ) ) users . add ( subscription . user_id ) for owner in subproject . project . owners . all ( ) : mails . append ( owner . profile . notify_merge_failure ( subproject , error , status ) ) mails . append ( get_notification_email ( u'en' , u'ADMINS' , u'merge_failure' , subproject , { u'subproject' : subproject , u'status' : status , u'error' : error } ) ) send_mails ( mails )
notification on merge failure .