There was an error while loading. Please reload this page.
1 parent d6d99f5 commit c622362Copy full SHA for c622362
1 file changed
pgweb/release/migrate.py
@@ -76,10 +76,11 @@ def do_migrate():
76
for cve in release.get('cve', []):
77
try:
78
patch = SecurityPatch.objects.get(cve=cve)
79
- patch.newspost = news
80
- patch.public = True
81
- patch.save(update_fields=['newspost', 'public'])
82
- print("Attached news article {} to CVE-{}".format(news.id, cve))
+ if patch.newspost != news or not patch.public:
+ patch.newspost = news
+ patch.public = True
+ patch.save(update_fields=['newspost', 'public'])
83
+ print("Attached news article {} to CVE-{}".format(news.id, cve))
84
except SecurityPatch.DoesNotExist:
85
print("Could not find CVE {}, cannot connect to announcement")
86
0 commit comments