providers/saml: some more cleanup, fix get_time_string when called without argument

This commit is contained in:
Jens Langhammer
2020-02-14 15:34:24 +01:00
parent e36d7928e4
commit 571373866e
3 changed files with 15 additions and 18 deletions

View File

@ -40,6 +40,8 @@ def timedelta_from_string(expr: str) -> datetime.timedelta:
def get_time_string(delta: datetime.timedelta = None) -> str:
"""Get Data formatted in SAML format"""
if delta is None:
delta = datetime.timedelta()
now = datetime.datetime.now()
final = now + delta
return final.strftime("%Y-%m-%dT%H:%M:%SZ")