Ejemplo n.º 1
0
def del_priv(request):
  try:
    user = _validate_and_get_geniuser(request)
  except LoggedInButFailedGetGeniUserError:
    return _show_failed_get_geniuser_page(request)
  
  if user.user_privkey == "":
    msg = "Your private key has already been deleted."
  else:
    interface.delete_private_key(user)
    msg = "Your private key has been deleted."
  return profile(request, msg)
Ejemplo n.º 2
0
def del_priv(request):
  try:
    user = _validate_and_get_geniuser(request)
  except LoggedInButFailedGetGeniUserError:
    return _show_failed_get_geniuser_page(request)
  
  if user.user_privkey == "":
    msg = "Your private key has already been deleted."
  else:
    interface.delete_private_key(user)
    msg = "Your private key has been deleted."
  return profile(request, msg)
Ejemplo n.º 3
0
# Create a user.
geniuser = interface.register_user(username, 'mypass', '*****@*****.**', 'myaffiliation')

# Get the user.
geniuser = interface.get_user_with_password(username, 'mypass')

# Make sure the private key was created because we didn't provide a pubkey when
# creating the user.
privkey = interface.get_private_key(geniuser)

if privkey is None:
  testfailed("private key wasn't created")

# Delete the private key and make sure it gets deleted.
interface.delete_private_key(geniuser)

privkey = interface.get_private_key(geniuser)
if privkey is not None:
  testfailed("private key wasn't deleted: " + str(privkey))

# Make sure they don't have any donations initially.
donations = interface.get_donations(geniuser)
if len(donations) > 0:
  testfailed("The user shouldn't have any donations.")

INITIAL_DONATION_COUNT = 6

# Create a few nodes and donations by this user.
for i in range(INITIAL_DONATION_COUNT):
  node_identifier = 'testnode' + username + str(i)