update batch

This commit is contained in:
2025-05-30 15:32:31 -03:00
parent efd962cdba
commit b048febbd5
24 changed files with 455 additions and 69 deletions

View File

@@ -125,6 +125,11 @@ def enroll(
ttl_expiration = ttl(
start_dt=now_ + timedelta(days=course.access_period - offset_days)
)
class DeduplicationConflictError(Exception):
def __init__(self, *args):
super().__init__('Enrollment already exists')
transact.put(
item={
'id': 'lock',
@@ -134,6 +139,7 @@ def enroll(
'ttl': ttl_expiration,
},
cond_expr='attribute_not_exists(sk)',
exc_cls=DeduplicationConflictError,
)
transact.put(
item={