Skip to content

Commit

Permalink
Merge pull request #7637 from fstagni/80_Accounting_fix
Browse files Browse the repository at this point in the history
[8.0] AccountingDB: only generate condition if needed
  • Loading branch information
fstagni authored Jun 4, 2024
2 parents 01f6503 + cae3b31 commit 2f1ebcd
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 @@ -1062,7 +1062,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 2f1ebcd

Please sign in to comment.