Skip to content

Commit

Permalink
Migrate university names
Browse files Browse the repository at this point in the history
  • Loading branch information
NickSklA committed Oct 26, 2023
1 parent 356a7aa commit e4855c0
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,20 @@ private boolean isGuest(LoginForm loginForm) {
return loginForm.getUsername().equals(guestUsername) && loginForm.getPassword().equals(guestPassword);
}

private String migrateUniversityName(String universityName) {
if (!universityName.endsWith(".gr")) {
return universityName + ".gr";
} else {
return universityName;
}
}

public ResponseEntity<Object> get(String university, String system, LoginForm loginForm, boolean getDocuments) {
if (isGuest(loginForm))
return getGuestStudent();

Options options = new Options();
options.university = university.toLowerCase(Locale.ROOT);
options.university = migrateUniversityName(university).toLowerCase(Locale.ROOT);
options.system = system != null ? system.toLowerCase(Locale.ROOT) : null;
options.username = loginForm.getUsername();
options.password = loginForm.getPassword();
Expand Down

0 comments on commit e4855c0

Please sign in to comment.