Skip to content

Commit

Permalink
FIX minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fgalan committed Nov 23, 2023
1 parent 59cf077 commit 141dc91
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/mongoBackend/MongoCommonUpdate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3694,9 +3694,9 @@ static unsigned int updateEntity
//
searchContextProviders(tenant, servicePathV, en, eP->attributeVector, cerP);

if (!(attributeAlreadyExistsNumber && (action == ActionTypeAppendStrict)))
if (!((*attributeAlreadyExistsNumber) > 0 && (action == ActionTypeAppendStrict)))
{
// Note that CER generation in the case of attributeAlreadyExistsError has its own logic at
// Note that CER generation in the case of attributeAlreadyExistsNumber has its own logic at
// processContextElement() function so we need to skip this addition or we will get duplicated
// CER
responseP->contextElementResponseVector.push_back(cerP);
Expand Down Expand Up @@ -4442,7 +4442,7 @@ unsigned int processContextElement
}
}

if ((apiVersion == V2) && (attributeAlreadyExistsNumber > 0) && (action == ActionTypeAppendStrict))
if ((attributeAlreadyExistsNumber > 0) && (action == ActionTypeAppendStrict))
{
std::string details = "one or more of the attributes in the request already exist: " + eP->id + " - " + attributeAlreadyExistsList;
buildGeneralErrorResponse(eP, NULL, responseP, SccBadRequest, details);
Expand Down

0 comments on commit 141dc91

Please sign in to comment.