hiding expired certs after 6 months from the main page

This commit is contained in:
Hossein Shafagh 2019-05-30 10:21:03 -07:00
parent b4d9ab9f0c
commit 071c083eae

View File

@ -330,6 +330,12 @@ def render(args):
query = database.session_query(Certificate)
time_range = args.pop("time_range")
if not time_range:
six_month_old = arrow.now()\
.shift(months=current_app.config.get("HIDE_EXPIRED_CERTS_AFTER_MONTHS", -6))\
.format("YYYY-MM-DD")
query = query.filter(Certificate.not_after > six_month_old)
destination_id = args.pop("destination_id")
notification_id = args.pop("notification_id", None)
show = args.pop("show")