Move date-checking logic to utils and unit test it

This commit is contained in:
Pea Tyczynska
2020-02-03 14:27:30 +00:00
parent caf77341b3
commit 7d460fe483
3 changed files with 18 additions and 5 deletions

View File

@@ -676,3 +676,9 @@ def format_thousands(value):
if value is None:
return ''
return value
def is_less_than_90_days_ago(date_from_db):
return (datetime.utcnow() - datetime.strptime(
date_from_db, '%a, %d %b %Y %X %Z'
)).days < 90