@user_registered.connect
def replace_unclaimed_user_with_registered(user):
 unreg_user_info = session.data.get('unreg_user')
 if unreg_user_info:
  unreg_user = User.load(unreg_user_info['uid'])
  pid = unreg_user_info['pid']
  node = Node.load(pid)
  node.replace_contributor(old=unreg_user, new=user)
  node.save()
  status.push_status_message('Successfully claimed contributor.', kind='success', trust=False)

@ user_registered . connect def replace_unclaimed_user_with_registered ( user ) : unreg_user_info = session . data . get ( 'unreg_user' ) if unreg_user_info : unreg_user = User . load ( unreg_user_info [ 'uid' ] ) pid = unreg_user_info [ 'pid' ] node = Node . load ( pid ) node . replace_contributor ( old = unreg_user , new = user ) node . save ( ) status . push_status_message ( 'Successfully claimed contributor.' , kind = 'success' , trust = False )
listens for the user_registered signal .