+ try:
+ request = PendingUser.objects.filter(email_hash= hash_code)
+ split_authority_hrn = request[0].authority_hrn.split('.')[0]
+ pis = authority_get_pis(request, split_authority_hrn)
+ pi_emails = []
+ for x in pis:
+ for e in x['pi_users']:
+ u = e.split('.')[1]
+ y = User.Objects.get(username = u)
+ if y.username.count("@") != 0:
+ if y.username.split("@")[1] == request[0].user_hrn.split("@")[1]:
+ pi_emails += [y.email]
+ subject = 'User email activated'
+ msg = 'The user %s has validated his/her email. Now you can validate his/her account' % (request[0].login)
+ send_mail(subject, msg, 'support@fibre.org.br', pi_emails, fail_silently = False)
+ except:
+ print "error sending the email!"