~cedric/freshermeat

5823fad7da93fa13256833ff67b72c62d5674c71 — Cédric Bonhomme 3 months ago 208c0d3
chg: [views] Improved the function which is generating the ATOM feed for the CVEs.
1 files changed, 4 insertions(+), 1 deletions(-)

M freshermeat/web/views/views.py
M freshermeat/web/views/views.py => freshermeat/web/views/views.py +4 -1
@@ 19,6 19,7 @@
import logging
import os
from datetime import timezone
from urllib.parse import urljoin

from feedgen.feed import FeedGenerator
from flask import current_app


@@ 125,7 126,9 @@ def recent_cves():
        fe.id(cve.cve_id)
        fe.title(f"{cve.project.name} - {cve.cve_id}")
        fe.description(cve.summary)
        fe.link(href="https://cvepremium.circl.lu/cve/" + cve.cve_id)
        fe.link(
            href=urljoin(application.config["CVE_SEARCH_INSTANCE"], f"cve/{cve.cve_id}")
        )
        fe.updated(cve.published_at.replace(tzinfo=timezone.utc))
        fe.published(cve.published_at.replace(tzinfo=timezone.utc))
    atomfeed = fg.atom_str(pretty=True)