add explicit error case

This commit is contained in:
Mike McLean 2021-12-08 11:07:55 -05:00 committed by Tomas Kopecek
parent 2bc2cce3c8
commit dee3405eb7

View file

@ -3236,6 +3236,8 @@ def name_or_id_clause(table, info):
raise koji.ParameterError('Invalid name or id value: %r' % info)
elif 'name' in info:
info = info['name']
else:
raise koji.ParameterError('Invalid name or id value: %r' % info)
if isinstance(info, int):
clause = f"({table}.id = %({table}_id)s)"
values = {f"{table}_id": info}