Skip to content

Commit

Permalink
avniproject/avni-webapp#1214 | Move syncConcept validation to before …
Browse files Browse the repository at this point in the history
…validateRowAndAssimilateErrors
  • Loading branch information
himeshr committed Aug 20, 2024
1 parent 9f93ac9 commit 20bdb04
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ private void write(Row row) throws Exception {
Locale locale = S.isEmpty(language) ? Locale.en : Locale.valueByName(language);
Organisation organisation = UserContextHolder.getUserContext().getOrganisation();
String userSuffix = "@".concat(organisation.getEffectiveUsernameSuffix());
JsonObject syncSettings = constructSyncSettings(row, rowValidationErrorMsgs);
validateRowAndAssimilateErrors(rowValidationErrorMsgs, fullAddress, catchmentName, nameOfUser, username, email, phoneNumber, language, datePickerMode, location, locale, userSuffix);
Catchment catchment = catchmentService.createOrUpdate(catchmentName, location);
User user = userRepository.findByUsername(username.trim());
Expand All @@ -140,7 +141,6 @@ private void write(Row row) throws Exception {
user.setEmail(email);
userService.setPhoneNumber(phoneNumber, user, RegionUtil.getCurrentUserRegion());
user.setName(nameOfUser.trim());
JsonObject syncSettings = constructSyncSettings(row, rowValidationErrorMsgs);
if (!isNewUser) resetSyncService.recordSyncAttributeValueChangeForUser(user, catchment.getId(), syncSettings);
user.setCatchment(catchment);
user.setOperatingIndividualScope(ByCatchment);
Expand Down

0 comments on commit 20bdb04

Please sign in to comment.