Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add date of publishing on vulnerability #1370

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

TG1999
Copy link
Member

@TG1999 TG1999 commented Dec 20, 2023

No description provided.

Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
from vulnerabilities.importers.nvd import NVDImporter
nvd_date = None
date_published = None
for advisory in self.advisories.all():
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use filter, for created_by = NVD and date_published != None, sort by latest date_collected, to get the latest updates.

if advisory.created_by == NVDImporter.__qualname__:
nvd_date = advisory.date_published
if nvd_date:
return nvd_date
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use isoformat here as well.

date_published = advisory.date_published
if advisory.date_published < date_published:
date_published = advisory.date_published
return date_published.isoformat()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return date_published.isoformat()
return date_published

super().save(*args, **kwargs)

@property
def get_date_published(self):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def get_date_published(self):
def find_date_published(self):

@TG1999 TG1999 marked this pull request as draft February 5, 2024 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant