updating dependencies, and fixing the deprecated arrow.replaces to shift

This commit is contained in:
Hossein Shafagh
2019-09-20 13:49:38 -07:00
parent ea8524f035
commit a13c45e9cc
13 changed files with 159 additions and 144 deletions

View File

@ -15,11 +15,11 @@ def convert_validity_years(data):
now = arrow.utcnow()
data["validity_start"] = now.isoformat()
end = now.replace(years=+int(data["validity_years"]))
end = now.shift(years=+int(data["validity_years"]))
if not current_app.config.get("LEMUR_ALLOW_WEEKEND_EXPIRATION", True):
if is_weekend(end):
end = end.replace(days=-2)
end = end.shift(days=-2)
data["validity_end"] = end.isoformat()
return data