def _sync_report(self, h1_report, now):
self.stdout.write(f"Synchronizing #{h1_report.id}.")
scope = h1_report.structured_scope
# Create or update the report
report, created = Report.objects.update_or_create(
defaults=dict(
title=h1_report.title,
created_at=h1_report.created_at,
triaged_at=h1_report.triaged_at,
closed_at=h1_report.closed_at,
disclosed_at=h1_report.disclosed_at,
state=h1_report.state,
issue_tracker_reference_url=h1_report.issue_tracker_reference_url or "",
weakness=h1_report.weakness.name if h1_report.weakness else "",
asset_identifier=scope and scope.asset_identifier,
asset_type=scope and scope.asset_type,
is_eligible_for_bounty=scope and scope.eligible_for_bounty,
last_synced_at=now,
),
id=h1_report.id
)
self._sync_bounties(report, h1_report)
self._sync_activities(report, h1_report)
评论列表
文章目录