fix add subtask from test files
authorLiana.Bakradze <liana.bakradze@jetbrains.com>
Fri, 11 Nov 2016 11:40:59 +0000 (14:40 +0300)
committerliana.bakradze <liana.bakradze@jetbrains.com>
Thu, 17 Nov 2016 14:08:44 +0000 (17:08 +0300)
python/educational-core/course-creator/src/com/jetbrains/edu/coursecreator/actions/CCNewSubtaskAction.java

index 663ac14cbd82e83cdd0dfea5a6818a218fc7e752..ae3558f524ed3028d8510966e8d59f9061523100 100644 (file)
@@ -25,7 +25,6 @@ import com.jetbrains.edu.learning.StudyUtils;
 import com.jetbrains.edu.learning.core.EduNames;
 import com.jetbrains.edu.learning.courseFormat.Course;
 import com.jetbrains.edu.learning.courseFormat.Task;
-import com.jetbrains.edu.learning.courseFormat.TaskFile;
 import org.jetbrains.annotations.NotNull;
 
 
@@ -50,11 +49,10 @@ public class CCNewSubtaskAction extends DumbAwareAction {
   }
 
   public static void addSubtask(@NotNull VirtualFile virtualFile, @NotNull Project project) {
-    TaskFile taskFile = StudyUtils.getTaskFile(project, virtualFile);
-    if (taskFile == null) {
+    Task task = StudyUtils.getTaskForFile(project, virtualFile);
+    if (task == null) {
       return;
     }
-    Task task = taskFile.getTask();
     VirtualFile taskDir = task.getTaskDir(project);
     if (taskDir == null) {
       return;