Fix plural
This commit is contained in:
parent
493a9dab30
commit
27a39e6bbc
1 changed files with 5 additions and 7 deletions
|
@ -10,18 +10,16 @@ from models import ssh_cert, x509_cert
|
||||||
|
|
||||||
|
|
||||||
def delta_text(delta):
|
def delta_text(delta):
|
||||||
if delta < timedelta(days=-2):
|
s = 's'[:abs(delta.days)^1]
|
||||||
return f"in {abs(delta.days)} days"
|
|
||||||
elif delta < timedelta(days=-1):
|
if delta < timedelta(days=-1):
|
||||||
return f"in {abs(delta.days)} day"
|
return f"in {abs(delta.days)} day{s}"
|
||||||
elif delta < timedelta(days=0):
|
elif delta < timedelta(days=0):
|
||||||
return "in less than a day"
|
return "in less than a day"
|
||||||
elif delta < timedelta(days=1):
|
elif delta < timedelta(days=1):
|
||||||
return "less than a day ago"
|
return "less than a day ago"
|
||||||
elif delta < timedelta(days=2):
|
|
||||||
return f"{delta.days} day ago"
|
|
||||||
else:
|
else:
|
||||||
return f"{delta.days} days ago"
|
return f"{delta.days} day{s} ago"
|
||||||
|
|
||||||
|
|
||||||
def list_ssh_certs(sort_key, revoked=False, expired=False):
|
def list_ssh_certs(sort_key, revoked=False, expired=False):
|
||||||
|
|
Loading…
Reference in a new issue