Skip to content

Commit

Permalink
Update default dates for date_qc_completed and date_ready_for_compute
Browse files Browse the repository at this point in the history
2 weeks and 4 weeks, respectively, are more in line with approximate
timeframes for past upload cycles.
  • Loading branch information
amstilp committed Aug 29, 2024
1 parent bd26e58 commit 3dd2cb8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def populate_uploadcycle_date_ready_for_compute(apps, schema_editor):
UploadCycle = apps.get_model("gregor_anvil", "UploadCycle")
# Create one UploadCycle for each unique version.
for row in UploadCycle.objects.all():
assumed_date_ready_for_compute = row.start_date + timedelta(days=7)
assumed_date_ready_for_compute = row.start_date + timedelta(weeks=4)
if row.end_date <= timezone.localdate():
row.date_ready_for_compute = assumed_date_ready_for_compute
row.full_clean()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def populate_uploadworkspace_date_qc_complete(apps, schema_editor):
UploadWorkspace = apps.get_model("gregor_anvil", "UploadWorkspace")
# Create one UploadWorkspace for each unique version.
for row in UploadWorkspace.objects.all():
assumed_date_qc_completed = row.upload_cycle.end_date + timedelta(days=7)
assumed_date_qc_completed = row.upload_cycle.end_date + timedelta(weeks=2)
if assumed_date_qc_completed <= timezone.localdate():
row.date_qc_completed = assumed_date_qc_completed
row.full_clean()
Expand Down
7 changes: 4 additions & 3 deletions gregor_django/gregor_anvil/tests/test_migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ def prepare(self):
def test_date_completed(self):
UploadCycle = self.old_state.apps.get_model("gregor_anvil", "UploadCycle")
upload_cycle = UploadCycle.objects.get(pk=self.upload_cycle_past.pk)
self.assertEqual(upload_cycle.date_ready_for_compute, upload_cycle.start_date + timedelta(days=7))
self.assertEqual(upload_cycle.date_ready_for_compute, upload_cycle.start_date + timedelta(weeks=4))
upload_cycle = UploadCycle.objects.get(pk=self.upload_cycle_current.pk)
self.assertIsNone(upload_cycle.date_ready_for_compute)
upload_cycle = UploadCycle.objects.get(pk=self.upload_cycle_future.pk)
Expand Down Expand Up @@ -432,7 +432,9 @@ def prepare(self):
def test_date_qc_completed(self):
UploadWorkspace = self.old_state.apps.get_model("gregor_anvil", "UploadWorkspace")
upload_workspace = UploadWorkspace.objects.get(pk=self.upload_workspace_past.pk)
self.assertEqual(upload_workspace.date_qc_completed, upload_workspace.upload_cycle.end_date + timedelta(days=7))
self.assertEqual(
upload_workspace.date_qc_completed, upload_workspace.upload_cycle.end_date + timedelta(weeks=2)
)
upload_workspace = UploadWorkspace.objects.get(pk=self.upload_workspace_current.pk)
self.assertIsNone(upload_workspace.date_qc_completed)
upload_workspace = UploadWorkspace.objects.get(pk=self.upload_workspace_future.pk)
Expand Down Expand Up @@ -514,7 +516,6 @@ def prepare(self):
workspace=workspace,
)


def test_date_completed(self):
CombinedConsortiumDataWorkspace = self.new_state.apps.get_model("gregor_anvil", "CombinedConsortiumDataWorkspace")
workspace = CombinedConsortiumDataWorkspace.objects.get(pk=self.combined_workspace_shared.pk)
Expand Down

0 comments on commit 3dd2cb8

Please sign in to comment.