fix: importer delete when imported_data is None (#1328)

This commit is contained in:
pablohashescobar 2023-06-20 10:24:38 +05:30 committed by GitHub
parent 0c3635cf25
commit c9ebc20a8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -239,6 +239,8 @@ class ImportServiceEndpoint(BaseAPIView):
importer = Importer.objects.get(
pk=pk, service=service, workspace__slug=slug
)
if importer.imported_data is not None:
# Delete all imported Issues
imported_issues = importer.imported_data.get("issues", [])
Issue.issue_objects.filter(id__in=imported_issues).delete()