-
Notifications
You must be signed in to change notification settings - Fork 182
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
base: main
Are you sure you want to change the base?
Conversation
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(): |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return date_published.isoformat() | |
return date_published |
super().save(*args, **kwargs) | ||
|
||
@property | ||
def get_date_published(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def get_date_published(self): | |
def find_date_published(self): |
No description provided.