Repository: oppia/oppia

Issue:
Merged Skills Persist After Merge, But Lose Questions
<!--
  - Thanks for taking the time to report a bug in the Oppia project.
  - Before filing a new issue, please do a quick search to check that it hasn't
  - already been filed on the [issue tracker](https://github.com/oppia/oppia/issues)._
  -->

**Describe the bug**
When skills are merged, the skill from which the merge was initiated loses its questions but survives.

**To Reproduce**
Steps to reproduce the behavior:
 1. Create 2 skills and 1 topic
 2. Assign 1 skill to the topic
 3. From the other skill, select `Merge Skill` and choose the first skill

**Observed behavior**
The skill from which the merge was initiated survives.

**Expected behavior**
The skill should disappear

**Desktop (please complete the following information; delete this section if the issue does not arise on desktop):**
 - OS: macOS
 - Browser: Firefox 78, Chrome 83
Merged Skills Persist After Merge, But Lose Questions
<!--
  - Thanks for taking the time to report a bug in the Oppia project.
  - Before filing a new issue, please do a quick search to check that it hasn't
  - already been filed on the [issue tracker](https://github.com/oppia/oppia/issues)._
  -->

**Describe the bug**
When skills are merged, the skill from which the merge was initiated loses its questions but survives.

**To Reproduce**
Steps to reproduce the behavior:
 1. Create 2 skills and 1 topic
 2. Assign 1 skill to the topic
 3. From the other skill, select `Merge Skill` and choose the first skill

**Observed behavior**
The skill from which the merge was initiated survives.

**Expected behavior**
The skill should disappear

**Desktop (please complete the following information; delete this section if the issue does not arise on desktop):**
 - OS: macOS
 - Browser: Firefox 78, Chrome 83


Discussion:
Hi @aks681 @kevintab95 @Showtim3 can this be fixed ASAP(by Jul 14)? We need it for the release
@aks681 PTAL!
Hi @aks681 @kevintab95 @Showtim3 can this be fixed ASAP(by Jul 14)? We need it for the release
@aks681 PTAL!

Resolving patch:
diff --git a/core/controllers/topics_and_skills_dashboard.py b/core/controllers/topics_and_skills_dashboard.py
--- a/core/controllers/topics_and_skills_dashboard.py
+++ b/core/controllers/topics_and_skills_dashboard.py
@@ -386,18 +386,12 @@ def post(self):
                     skill_domain.SKILL_PROPERTY_SUPERSEDING_SKILL_ID),
                 'old_value': old_skill.superseding_skill_id,
                 'new_value': new_skill_id
-            }),
-            skill_domain.SkillChange({
-                'cmd': skill_domain.CMD_UPDATE_SKILL_PROPERTY,
-                'property_name': (
-                    skill_domain.SKILL_PROPERTY_ALL_QUESTIONS_MERGED),
-                'old_value': False,
-                'new_value': True
             })
         ]
         skill_services.update_skill(
             self.user_id, old_skill_id, changelist,
             'Marking the skill as having being merged successfully.')
+        skill_services.delete_skill(self.user_id, old_skill_id)
         self.render_json({
             'merged_into_skill': new_skill_id
         })


Test patch: