Skip to content

Commit 12c848f

Browse files
qcdyxdavidgamez
andauthored
Update functions-python/tasks_executor/src/tasks/licenses/populate_licenses.py
Co-authored-by: David Gamez <[email protected]>
1 parent 7146ae2 commit 12c848f

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

functions-python/tasks_executor/src/tasks/licenses/populate_licenses.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,11 @@ def populate_licenses_task(dry_run, db_session):
8989
if not license_object:
9090
license_object = License(id=license_id)
9191
license_object.created_at = datetime.now(timezone.utc)
92+
license_object.is_spdx = is_spdx
93+
license_object.type = "standard"
9294
# Add the new license object to the session immediately.
9395
# This makes it "pending" and allows SQLAlchemy to track relationship changes.
9496
db_session.add(license_object)
95-
96-
license_object.is_spdx = is_spdx
97-
if is_spdx:
98-
license_object.type = "standard"
99-
else:
100-
license_object.type = "custom"
10197
license_object.name = spdx_data.get("name")
10298
license_object.updated_at = datetime.now(timezone.utc)
10399
cross_ref_list = spdx_data.get("crossRef")

0 commit comments

Comments
 (0)