Skip to content

Commit

Permalink
Fix failing tests #1524
Browse files Browse the repository at this point in the history
Signed-off-by: tdruez <[email protected]>
  • Loading branch information
tdruez committed Jan 10, 2025
1 parent d8d0908 commit 611520e
Show file tree
Hide file tree
Showing 18 changed files with 6,485 additions and 4,328 deletions.
12 changes: 9 additions & 3 deletions scanpipe/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2925,7 +2925,9 @@ def create_from_data(cls, project, resource_data):
cleaned_data = {
field_name: value
for field_name, value in resource_data.items()
if field_name in cls.model_fields() and value not in EMPTY_VALUES
if field_name in cls.model_fields()
and value not in EMPTY_VALUES
and field_name != "project"
}

return cls.objects.create(project=project, **cleaned_data)
Expand Down Expand Up @@ -3463,7 +3465,9 @@ def create_from_data(cls, project, package_data):
cleaned_data = {
field_name: value
for field_name, value in package_data.items()
if field_name in cls.model_fields() and value not in EMPTY_VALUES
if field_name in cls.model_fields()
and value not in EMPTY_VALUES
and field_name != "project"
}

discovered_package = cls(project=project, **cleaned_data)
Expand Down Expand Up @@ -3924,7 +3928,9 @@ def create_from_data(
cleaned_data = {
field_name: value
for field_name, value in dependency_data.items()
if field_name in cls.model_fields() and value not in EMPTY_VALUES
if field_name in cls.model_fields()
and value not in EMPTY_VALUES
and field_name != "project"
}

return cls.objects.create(
Expand Down
Loading

0 comments on commit 611520e

Please sign in to comment.