Skip to content

Commit

Permalink
Merge pull request DIRACGrid#7640 from DIRACGridBot/cherry-pick-2-2f1…
Browse files Browse the repository at this point in the history
…ebcd99-integration

[sweep:integration] AccountingDB: only generate condition if needed
  • Loading branch information
fstagni authored Jun 5, 2024
2 parents 60e2d82 + 922601b commit b48aea6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/DIRAC/AccountingSystem/DB/AccountingDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,8 @@ def __queryType(
sqlORList.append(f"`{_getTableName('key', typeName, keyName)}`.`value` = {keyValue}")
else:
sqlORList.append(f"`{tableName}`.`{keyName}` = {keyValue}")
sqlCondList.append(f"( {' OR '.join(sqlORList)} )")
if sqlORList:
sqlCondList.append(f"( {' OR '.join(sqlORList)} )")
if sqlCondList:
cmd += f" AND {' AND '.join(sqlCondList)}"
# Calculate grouping and sorting
Expand Down

0 comments on commit b48aea6

Please sign in to comment.