Skip to content
Snippets Groups Projects
Commit 1c50c5ed authored by Guillaume ROUSSE's avatar Guillaume ROUSSE
Browse files

better fix, as the error happens before database access

parent e550ccb0
No related branches found
No related tags found
No related merge requests found
......@@ -108,28 +108,28 @@ foreach my $id (keys %{$configuration->{federations}}) {
);
$entity->update();
} else {
$entity = AccountManager::Entity->new(
db => $db,
type => $entry->{type},
entityid => $entry->{entityid},
display_name => $entry->{display_name},
information_url => $entry->{information_url},
organization_url => $entry->{organization_url},
);
if ($entry->{contacts}) {
my @contacts =
eval {
$entity = AccountManager::Entity->new(
db => $db,
type => $entry->{type},
entityid => $entry->{entityid},
display_name => $entry->{display_name},
information_url => $entry->{information_url},
organization_url => $entry->{organization_url},
);
if ($entry->{contacts}) {
my @contacts =
uniq
grep { $_ }
map { $_->{EmailAddress} }
@{$entry->{contacts}};
$entity->contacts(@contacts);
}
$entity->federations($id);
eval {
$entity->contacts(@contacts);
}
$entity->federations($id);
$entity->save();
};
if ($EVAL_ERROR) {
warn "error while saving entity $entry->{entityid}: $EVAL_ERROR";
warn "error while processing entity $entry->{entityid}: $EVAL_ERROR";
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment