def send_claim_registered_email(claimer, unclaimed_user, node, throttle=(24 * 3600)):
 unclaimed_record = unclaimed_user.get_unclaimed_record(node._primary_key)
 timestamp = unclaimed_record.get('last_sent')
 if (not throttle_period_expired(timestamp, throttle)):
  raise HTTPError(http.BAD_REQUEST, data=dict(message_long='User account can only be claimed with an existing user once every 24 hours'))
 verification_key = generate_verification_key(verification_type='claim')
 unclaimed_record['token'] = verification_key['token']
 unclaimed_record['expires'] = verification_key['expires']
 unclaimed_record['claimer_email'] = claimer.username
 unclaimed_user.save()
 referrer = User.load(unclaimed_record['referrer_id'])
 claim_url = web_url_for('claim_user_registered', uid=unclaimed_user._primary_key, pid=node._primary_key, token=unclaimed_record['token'], _external=True)
 mails.send_mail(referrer.username, mails.FORWARD_INVITE_REGISTERED, user=unclaimed_user, referrer=referrer, node=node, claim_url=claim_url, fullname=unclaimed_record['name'])
 unclaimed_record['last_sent'] = get_timestamp()
 unclaimed_user.save()
 mails.send_mail(claimer.username, mails.PENDING_VERIFICATION_REGISTERED, fullname=claimer.fullname, referrer=referrer, node=node)

def send_claim_registered_email ( claimer , unclaimed_user , node , throttle = ( 24 * 3600 ) ) : unclaimed_record = unclaimed_user . get_unclaimed_record ( node . _primary_key ) timestamp = unclaimed_record . get ( 'last_sent' ) if ( not throttle_period_expired ( timestamp , throttle ) ) : raise HTTPError ( http . BAD_REQUEST , data = dict ( message_long = 'User account can only be claimed with an existing user once every 24 hours' ) ) verification_key = generate_verification_key ( verification_type = 'claim' ) unclaimed_record [ 'token' ] = verification_key [ 'token' ] unclaimed_record [ 'expires' ] = verification_key [ 'expires' ] unclaimed_record [ 'claimer_email' ] = claimer . username unclaimed_user . save ( ) referrer = User . load ( unclaimed_record [ 'referrer_id' ] ) claim_url = web_url_for ( 'claim_user_registered' , uid = unclaimed_user . _primary_key , pid = node . _primary_key , token = unclaimed_record [ 'token' ] , _external = True ) mails . send_mail ( referrer . username , mails . FORWARD_INVITE_REGISTERED , user = unclaimed_user , referrer = referrer , node = node , claim_url = claim_url , fullname = unclaimed_record [ 'name' ] ) unclaimed_record [ 'last_sent' ] = get_timestamp ( ) unclaimed_user . save ( ) mails . send_mail ( claimer . username , mails . PENDING_VERIFICATION_REGISTERED , fullname = claimer . fullname , referrer = referrer , node = node )
a registered user claiming the unclaimed user account as an contributor to a project .