Skip to content

Commit

Permalink
Update AIPScan database with deleted SS AIPs, #199
Browse files Browse the repository at this point in the history
  • Loading branch information
melaniekung committed Sep 1, 2023
1 parent c45b917 commit 0eefcb4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions AIPscan/Aggregator/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,16 @@ def parse_packages_and_load_mets(
for package_obj in package_list.get(OBJECTS, []):
package = process_package_object(package_obj)
packages.append(package)

if package.is_deleted():
logger.warning("Package deleted from SS: '%s'", package.uuid)

Check warning on line 119 in AIPscan/Aggregator/tasks.py

View check run for this annotation

Codecov / codecov/patch

AIPscan/Aggregator/tasks.py#L119

Added line #L119 was not covered by tests

deleted_aip = AIP.query.filter_by(uuid=package.uuid).first()

Check warning on line 121 in AIPscan/Aggregator/tasks.py

View check run for this annotation

Codecov / codecov/patch

AIPscan/Aggregator/tasks.py#L121

Added line #L121 was not covered by tests

if deleted_aip != None:
logger.warning("Deleting AIP: %s", package.uuid)
database_helpers.delete_aip_object(deleted_aip)

Check warning on line 125 in AIPscan/Aggregator/tasks.py

View check run for this annotation

Codecov / codecov/patch

AIPscan/Aggregator/tasks.py#L124-L125

Added lines #L124 - L125 were not covered by tests

if not package.is_aip():
continue
start_mets_task(
Expand Down

0 comments on commit 0eefcb4

Please sign in to comment.