migration fix

This commit is contained in:
Efstratios Giannopoulos 2024-11-08 15:32:14 +02:00
parent ba2a83eef0
commit 647086f1dd
1 changed files with 4 additions and 0 deletions

View File

@ -129,6 +129,10 @@ public class UserMigrationService {
data.setLanguage(language);
data.setAvatarUrl(avatarUrl);
item.setAdditionalInfo(this.jsonHandlingService.toJson(data));
if (item.getName() == null || item.getName().isBlank()) {
if (oldUser != null && oldUser.getEmail() != null && !item.getName().isBlank()) item.setName(oldUser.getEmail());
else item.setName("No name");
}
this.entityManager.persist(item);
}
this.entityManager.flush();