Skip to content

Commit

Permalink
sweep: DIRACGrid#7637 AccountingDB: only generate condition if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
fstagni authored and web-flow committed Jun 4, 2024
1 parent 60e2d82 commit 922601b
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 922601b

Please sign in to comment.