Skip to content

Commit 5b27830

Browse files
committed
Updating build details importer and artifact check bug.
1 parent 3ffe4e2 commit 5b27830

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

dojo/api.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,8 +1203,7 @@ class Meta:
12031203

12041204
authentication = DojoApiKeyAuthentication()
12051205
authorization = DjangoAuthorization()
1206-
#validation = ImportScanValidation()
1207-
#object_class = ImportScanObject
1206+
object_class = ImportScanObject
12081207

12091208
def hydrate(self, bundle):
12101209
bundle.obj.__setattr__('engagement_obj',

dojo/object/parser.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def find_item(item, object_queryset):
3232
object_type = None
3333
found_object = None
3434

35+
#Check for file
3536
for object in object_queryset:
3637
if object.path == item:
3738
object_type = "file"
@@ -43,9 +44,9 @@ def find_item(item, object_queryset):
4344
found_object = object
4445
break
4546
elif object.artifact is not None:
46-
object_type = "artifact"
47-
found_object = object
4847
if item in object.artifact:
48+
object_type = "artifact"
49+
found_object = object
4950
break
5051

5152
return object_type, found_object
@@ -59,13 +60,14 @@ def import_object_eng(request, engagement, json_data):
5960

6061
#Retrieve the files currently set for this product
6162
object_queryset = Objects.objects.filter(product=engagement.product.id).order_by('-path')
62-
data = json.loads(json_data)
63+
data = json.load(json_data)
6364

6465
#Set default review status
6566
review_status_id = 1
6667
review_status = Objects_Review.objects.get(pk=review_status_id)
6768

6869
for file in data:
70+
print file["path"]
6971
#Save the file if the object isn't in object table
7072
file_type, found_object = find_item(file["path"], object_queryset)
7173

0 commit comments

Comments
 (0)