From 63e5e0c862558ba4ee3d5d63da08379794b35761 Mon Sep 17 00:00:00 2001 From: 0x29a Date: Tue, 16 Jul 2024 15:28:46 +0200 Subject: [PATCH] feat: make lease expiration times configurable --- openassessment/assessment/models/peer.py | 3 ++- openassessment/assessment/models/staff.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/openassessment/assessment/models/peer.py b/openassessment/assessment/models/peer.py index de3db261f9..9d066d57c0 100644 --- a/openassessment/assessment/models/peer.py +++ b/openassessment/assessment/models/peer.py @@ -13,6 +13,7 @@ import logging import random +from django.conf import settings from django.db import DatabaseError, models from django.utils.timezone import now @@ -108,7 +109,7 @@ class PeerWorkflow(models.Model): """ # Amount of time before a lease on a submission expires - TIME_LIMIT = timedelta(hours=8) + TIME_LIMIT = timedelta(hours=getattr(settings, "PEER_LEASE_EXPIRATION_HOURS", 8)) student_id = models.CharField(max_length=40, db_index=True) item_id = models.CharField(max_length=255, db_index=True) diff --git a/openassessment/assessment/models/staff.py b/openassessment/assessment/models/staff.py index a2557ea9e5..e0e414608d 100644 --- a/openassessment/assessment/models/staff.py +++ b/openassessment/assessment/models/staff.py @@ -6,6 +6,7 @@ from datetime import timedelta import logging +from django.conf import settings from django.db import DatabaseError, models from django.utils.timezone import now @@ -28,7 +29,7 @@ class StaffWorkflow(models.Model): """ # Amount of time before a lease on a submission expires - TIME_LIMIT = timedelta(hours=8) + TIME_LIMIT = timedelta(hours=getattr(settings, "STAFF_LEASE_EXPIRATION_HOURS", 8)) scorer_id = models.CharField(max_length=40, db_index=True, blank=True) course_id = models.CharField(max_length=255, db_index=True)