Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use TIME_ZONE from settings for AIP Package.stored_date values #637

Merged
merged 1 commit into from
Aug 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions storage_service/locations/models/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from collections import namedtuple
import codecs
import copy
from datetime import datetime
import distutils.dir_util
import json
import logging
Expand All @@ -21,6 +20,7 @@
# Core Django, alphabetical
from django.conf import settings
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _

# Third party dependencies, alphabetical
Expand Down Expand Up @@ -731,7 +731,7 @@ def replicate(self, replicator_location):
)
if dest_space.access_protocol not in (Space.LOM, Space.ARKIVUM):
replica_package.status = Package.UPLOADED
replica_package.stored_date = datetime.now()
replica_package.stored_date = timezone.now()
replica_package.save()
dest_space.post_move_from_storage_service(
staging_path=replica_package.current_path,
Expand Down Expand Up @@ -981,7 +981,7 @@ def _store_aip_to_uploaded(self, v, related_package_uuid):
related_package = Package.objects.get(uuid=related_package_uuid)
self.related_packages.add(related_package)
self.status = Package.UPLOADED
self.stored_date = datetime.now()
self.stored_date = timezone.now()
self.save()
self._update_quotas(v.dest_space, self.current_location)
return storage_effects, checksum
Expand Down Expand Up @@ -1024,7 +1024,7 @@ def _store_aip_to_uploaded(self, v, related_package_uuid):
# Update package status once transferred to SS
if v.dest_space.access_protocol not in (Space.LOM, Space.ARKIVUM):
self.status = Package.UPLOADED
self.stored_date = datetime.now()
self.stored_date = timezone.now()
if related_package_uuid is not None:
related_package = Package.objects.get(uuid=related_package_uuid)
self.related_packages.add(related_package)
Expand Down