Skip to content

Instantly share code, notes, and snippets.

@yzdann
Created February 18, 2020 09:41
Show Gist options
  • Save yzdann/42bbf8ce6d4d9e2426be2b6508382d90 to your computer and use it in GitHub Desktop.
Save yzdann/42bbf8ce6d4d9e2426be2b6508382d90 to your computer and use it in GitHub Desktop.
import datetime
from web_service.models import ServerCves
from web_service.tasks import schedule_server_cve_relations
date_of_core_hotfix_update = datetime.datetime(2020, 1, 12, 0, 0)
broken_servercves = ServerCves.objects.filter(added_date__gt=date_of_core_hotfix_update)
cve_list = broken_servercves.values_list('cve', flat=True).distinct()
broken_servercves.delete()
schedule_server_cve_relations(cve_list)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment