allow . and @ in ssh key names

This commit is contained in:
forest 2020-05-11 23:09:11 -05:00
parent 5df06dc1b3
commit 54948a386b
2 changed files with 6 additions and 3 deletions

View File

@ -171,8 +171,8 @@ def ssh_public_keys():
name = request.form["name"]
if not name or len(name.strip()) < 1:
errors.append("Name is required")
elif not re.match(r"^[0-9A-Za-z_ -]+$", name):
errors.append("Name must match \"^[0-9A-Za-z_ -]+$\"")
elif not re.match(r"^[0-9A-Za-z_@. -]+$", name):
errors.append("Name must match \"^[0-9A-Za-z_@. -]+$\"")
if method == "POST":
content = request.form["content"]
@ -223,7 +223,7 @@ def get_account_balance():
vm_months = ( end_datetime - vm["created"] ).days / average_number_of_days_in_a_month
vm_cost_dollars += vm_months * float(vm["dollars_per_month"])
payment_dollars_total = sum(map(lambda x: x["dollars"], get_payments()))
payment_dollars_total = float( sum(map(lambda x: x["dollars"], get_payments())) )
return payment_dollars_total - vm_cost_dollars

View File

@ -82,4 +82,7 @@ VALUES ('f1-s', 5.33, 512, 1, 500),
INSERT INTO accounts (email)
VALUES ('forest.n.johnson@gmail.com');
INSERT INTO payments (email, dollars, created)
VALUES ('forest.n.johnson@gmail.com', 100.00, TO_TIMESTAMP('2020-05-05','YYYY-MM-DD'));
UPDATE schemaversion SET version = 2;