@must_be_contributor_or_public
def claim_user_post(node, **kwargs):
 request_data = request.json
 unclaimed_user = User.load(request_data['pk'])
 unclaimed_data = unclaimed_user.get_unclaimed_record(node._primary_key)
 if ('value' in request_data):
  email = request_data['value'].lower().strip()
  claimer = get_user(email=email)
  if (claimer and claimer.is_registered):
   send_claim_registered_email(claimer, unclaimed_user, node)
  else:
   send_claim_email(email, unclaimed_user, node, notify=True)
 elif ('claimerId' in request_data):
  claimer_id = request_data['claimerId']
  claimer = User.load(claimer_id)
  send_claim_registered_email(claimer, unclaimed_user, node)
  email = claimer.username
 else:
  raise HTTPError(http.BAD_REQUEST)
 return {'status': 'success', 'email': email, 'fullname': unclaimed_data['name']}

@ must_be_contributor_or_public def claim_user_post ( node , ** kwargs ) : request_data = request . json unclaimed_user = User . load ( request_data [ 'pk' ] ) unclaimed_data = unclaimed_user . get_unclaimed_record ( node . _primary_key ) if ( 'value' in request_data ) : email = request_data [ 'value' ] . lower ( ) . strip ( ) claimer = get_user ( email = email ) if ( claimer and claimer . is_registered ) : send_claim_registered_email ( claimer , unclaimed_user , node ) else : send_claim_email ( email , unclaimed_user , node , notify = True ) elif ( 'claimerId' in request_data ) : claimer_id = request_data [ 'claimerId' ] claimer = User . load ( claimer_id ) send_claim_registered_email ( claimer , unclaimed_user , node ) email = claimer . username else : raise HTTPError ( http . BAD_REQUEST ) return { 'status' : 'success' , 'email' : email , 'fullname' : unclaimed_data [ 'name' ] }
view for claiming a user from the x-editable form on a project page .