fix import with domain setup dns verification (#98)

Co-authored-by: Michael Hoennig <michael@hoennig.de>
Reviewed-on: #98
Reviewed-by: Marc Sandlus <marc.sandlus@hostsharing.net>
This commit is contained in:
Michael Hoennig 2024-09-11 13:32:49 +02:00
parent a7d586f0f7
commit 13f258fb90
2 changed files with 6 additions and 3 deletions

View File

@ -26,9 +26,11 @@ class HsDomainSetupHostingAssetValidator extends HostingAssetEntityValidator {
@Override @Override
public List<String> validateEntity(final HsHostingAsset assetEntity) { public List<String> validateEntity(final HsHostingAsset assetEntity) {
final var violations = // new ArrayList<String>(); final var violations = super.validateEntity(assetEntity);
super.validateEntity(assetEntity); if (!violations.isEmpty() || assetEntity.isLoaded()) {
if (!violations.isEmpty()) { // it makes no sense to do DNS-based validation
// if the entity is already persisted or
// if the identifier (domain name) or structure is already invalid
return violations; return violations;
} }

View File

@ -1450,6 +1450,7 @@ public class ImportHostingAssets extends BaseOfficeDataImport {
// nothing here // nothing here
)) ))
.build(); .build();
domainSetupAsset.markAsLoaded(); // to skip setup verification
domainSetupsByName.put(domain_name, domainSetupAsset); domainSetupsByName.put(domain_name, domainSetupAsset);
domainSetupAssets.put(domain_id, domainSetupAsset); domainSetupAssets.put(domain_id, domainSetupAsset);
domainSetupAsset.setSubHostingAssets(new ArrayList<>()); domainSetupAsset.setSubHostingAssets(new ArrayList<>());