From b02c151458fae4eda9d9f5c3211f5c5467b5c034 Mon Sep 17 00:00:00 2001 From: Pawan Verma Date: Tue, 3 Oct 2023 12:50:11 +0530 Subject: [PATCH] Fix duplicate learn modules created on submitting forms --- commcare_connect/opportunity/tasks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commcare_connect/opportunity/tasks.py b/commcare_connect/opportunity/tasks.py index 8d4aa044..227e1a79 100644 --- a/commcare_connect/opportunity/tasks.py +++ b/commcare_connect/opportunity/tasks.py @@ -22,8 +22,9 @@ def create_learn_modules_assessments(opportunity_id): for block in connect_blocks: LearnModule.objects.update_or_create( app=learn_app, - name=block.name, + slug=block.id, defaults={ + "name": block.name, "description": block.description, "time_estimate": block.time_estimate, },