fix duplicate user
This commit is contained in:
@@ -270,21 +270,11 @@ def _enroll_now(enrollment: Enrollment, context: Context) -> None:
|
||||
'seat': {'order_id': order_id},
|
||||
}
|
||||
)
|
||||
# Relationships between this enrollment and its related entities
|
||||
transact.put(
|
||||
item={
|
||||
'id': order_id,
|
||||
'sk': f'LINKED_ENTITIES#CHILD#ENROLLMENT#{enrollment.id}',
|
||||
'created_at': now_,
|
||||
},
|
||||
cond_expr='attribute_not_exists(sk)',
|
||||
table_name=ORDER_TABLE,
|
||||
)
|
||||
# Child knows the parent
|
||||
# Enrollment should know where it comes from
|
||||
transact.put(
|
||||
item={
|
||||
'id': enrollment.id,
|
||||
'sk': f'LINKED_ENTITIES#PARENT#ORDER#{order_id}',
|
||||
'sk': f'LINKED_ENTITY#PARENT#ORDER#{order_id}',
|
||||
'created_at': now_,
|
||||
},
|
||||
cond_expr='attribute_not_exists(sk)',
|
||||
|
||||
Reference in New Issue
Block a user