From 11b8b818f3a1e2b810de20907725561b009f9297 Mon Sep 17 00:00:00 2001 From: Cedric Ong <67156011+cedricongjh@users.noreply.github.com> Date: Tue, 26 Mar 2024 17:56:27 +0800 Subject: [PATCH] fix resetAccountAction (#12934) Co-authored-by: Zhang Ziqing <69516975+ziqing26@users.noreply.github.com> --- .../ui/webapi/ResetAccountAction.java | 28 +++---------------- 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/src/main/java/teammates/ui/webapi/ResetAccountAction.java b/src/main/java/teammates/ui/webapi/ResetAccountAction.java index 48dee9da59d..7fe2d9680c7 100644 --- a/src/main/java/teammates/ui/webapi/ResetAccountAction.java +++ b/src/main/java/teammates/ui/webapi/ResetAccountAction.java @@ -35,12 +35,7 @@ public JsonResult execute() { wrongGoogleId = existingStudent.getGoogleId(); try { - if (isAccountMigrated(wrongGoogleId)) { - sqlLogic.resetStudentGoogleId(studentEmail, courseId, wrongGoogleId); - } else { - logic.resetStudentGoogleId(studentEmail, courseId); - } - + sqlLogic.resetStudentGoogleId(studentEmail, courseId, wrongGoogleId); taskQueuer.scheduleCourseRegistrationInviteToStudent(courseId, studentEmail, true); } catch (EntityDoesNotExistException e) { throw new EntityNotFoundException(e); @@ -55,12 +50,7 @@ public JsonResult execute() { wrongGoogleId = existingInstructor.getGoogleId(); try { - if (isAccountMigrated(wrongGoogleId)) { - sqlLogic.resetInstructorGoogleId(instructorEmail, courseId, wrongGoogleId); - } else { - logic.resetInstructorGoogleId(instructorEmail, courseId); - } - + sqlLogic.resetInstructorGoogleId(instructorEmail, courseId, wrongGoogleId); taskQueuer.scheduleCourseRegistrationInviteToInstructor(null, instructorEmail, courseId, true); } catch (EntityDoesNotExistException e) { throw new EntityNotFoundException(e); @@ -76,12 +66,7 @@ public JsonResult execute() { wrongGoogleId = existingStudent.getGoogleId(); try { - if (isAccountMigrated(wrongGoogleId)) { - sqlLogic.resetStudentGoogleId(studentEmail, courseId, wrongGoogleId); - } else { - logic.resetStudentGoogleId(studentEmail, courseId); - } - + logic.resetStudentGoogleId(studentEmail, courseId); taskQueuer.scheduleCourseRegistrationInviteToStudent(courseId, studentEmail, true); } catch (EntityDoesNotExistException e) { throw new EntityNotFoundException(e); @@ -95,12 +80,7 @@ public JsonResult execute() { wrongGoogleId = existingInstructor.getGoogleId(); try { - if (isAccountMigrated(wrongGoogleId)) { - sqlLogic.resetInstructorGoogleId(instructorEmail, courseId, wrongGoogleId); - } else { - logic.resetInstructorGoogleId(instructorEmail, courseId); - } - + logic.resetInstructorGoogleId(instructorEmail, courseId); taskQueuer.scheduleCourseRegistrationInviteToInstructor(null, instructorEmail, courseId, true); } catch (EntityDoesNotExistException e) { throw new EntityNotFoundException(e);