add some TODOs

pull/1/head
nathaniel smith 2016-11-30 00:32:53 -08:00
parent 66622831d5
commit 55b4f7aa2a
1 changed files with 3 additions and 0 deletions

View File

@ -25,6 +25,8 @@ NOT_A_ROBOT = 'four'
# <_< # <_<
def validate_username(username): def validate_username(username):
# TODO actually check for existence of user on the current system with
# username
if len(username) < USERNAME_MIN_LENGTH: if len(username) < USERNAME_MIN_LENGTH:
raise ValidationError('Username too short.') raise ValidationError('Username too short.')
if not USERNAME_RE.match(username): if not USERNAME_RE.match(username):
@ -37,6 +39,7 @@ def validate_displayname(display_name):
raise ValidationError("Valid characters: a-z, A-Z, 0-9, -, _, and '.") raise ValidationError("Valid characters: a-z, A-Z, 0-9, -, _, and '.")
def validate_pubkey(pubkey): def validate_pubkey(pubkey):
# TODO see if I can get the type out
key = ssh.SSHKey(pubkey, strict_mode=False, skip_option_parsing=True) key = ssh.SSHKey(pubkey, strict_mode=False, skip_option_parsing=True)
try: try:
key.parse() key.parse()