If enabled, allow users and orgs to set their time machine expiration

Fixes https://www.pivotaltracker.com/story/show/142881203
This commit is contained in:
Joseph Schorr 2017-04-05 14:01:55 -04:00
parent eb5cebbcdf
commit 3dcbe3c631
25 changed files with 472 additions and 15 deletions

View file

@ -15,6 +15,7 @@ def convert_to_timedelta(time_val):
m Minutes '5m' -> 5 Minutes
h Hours '24h' -> 24 Hours
d Days '7d' -> 7 Days
w Weeks '2w' -> 2 weeks
========= ======= ===================
Examples::
@ -37,5 +38,7 @@ def convert_to_timedelta(time_val):
return timedelta(hours=num)
elif time_val.endswith('d'):
return timedelta(days=num)
elif time_val.endswith('w'):
return timedelta(days=num*7)
else:
raise ValueError('Unknown suffix on timedelta: %s' % time_val)