From 55b3bf198622ab1d9150f6fb21e907a125e675b1 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/__init__.py | 2 +- openassessment/assessment/models/peer.py | 3 ++- openassessment/assessment/models/staff.py | 3 ++- package.json | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/openassessment/__init__.py b/openassessment/__init__.py index 2ab4acfb51..ec32d286dc 100644 --- a/openassessment/__init__.py +++ b/openassessment/__init__.py @@ -2,4 +2,4 @@ Initialization Information for Open Assessment Module """ -__version__ = '6.12.1' +__version__ = '6.12.2' diff --git a/openassessment/assessment/models/peer.py b/openassessment/assessment/models/peer.py index de3db261f9..8fa13006b6 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, "ORA_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..53ac1a2827 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, "ORA_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) diff --git a/package.json b/package.json index e067bbdf91..5256e11692 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "edx-ora2", - "version": "6.12.1", + "version": "6.12.2", "repository": "https://github.com/openedx/edx-ora2.git", "dependencies": { "@edx/frontend-build": "8.0.6",