Skip to content

Commit

Permalink
fix resetAccountAction (#12934)
Browse files Browse the repository at this point in the history
Co-authored-by: Zhang Ziqing <69516975+ziqing26@users.noreply.github.com>
  • Loading branch information
cedricongjh and ziqing26 authored Mar 26, 2024
1 parent a02f444 commit 11b8b81
Showing 1 changed file with 4 additions and 24 deletions.
28 changes: 4 additions & 24 deletions src/main/java/teammates/ui/webapi/ResetAccountAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 11b8b81

Please sign in to comment.