Skip to content

Commit

Permalink
feat: make lease expiration times configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
0x29a committed Jul 16, 2024
1 parent 8b320d6 commit 63e5e0c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion openassessment/assessment/models/peer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion openassessment/assessment/models/staff.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand Down

0 comments on commit 63e5e0c

Please sign in to comment.