forked from 3wordchant/capsul-flask
allow . and @ in ssh key names
This commit is contained in:
parent
5df06dc1b3
commit
54948a386b
@ -171,8 +171,8 @@ def ssh_public_keys():
|
|||||||
name = request.form["name"]
|
name = request.form["name"]
|
||||||
if not name or len(name.strip()) < 1:
|
if not name or len(name.strip()) < 1:
|
||||||
errors.append("Name is required")
|
errors.append("Name is required")
|
||||||
elif not re.match(r"^[0-9A-Za-z_ -]+$", name):
|
elif not re.match(r"^[0-9A-Za-z_@. -]+$", name):
|
||||||
errors.append("Name must match \"^[0-9A-Za-z_ -]+$\"")
|
errors.append("Name must match \"^[0-9A-Za-z_@. -]+$\"")
|
||||||
|
|
||||||
if method == "POST":
|
if method == "POST":
|
||||||
content = request.form["content"]
|
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_months = ( end_datetime - vm["created"] ).days / average_number_of_days_in_a_month
|
||||||
vm_cost_dollars += vm_months * float(vm["dollars_per_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
|
return payment_dollars_total - vm_cost_dollars
|
||||||
|
|
||||||
|
@ -82,4 +82,7 @@ VALUES ('f1-s', 5.33, 512, 1, 500),
|
|||||||
INSERT INTO accounts (email)
|
INSERT INTO accounts (email)
|
||||||
VALUES ('forest.n.johnson@gmail.com');
|
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;
|
UPDATE schemaversion SET version = 2;
|
Loading…
Reference in New Issue
Block a user