This change centralizes logic for accepting either name or id (or a dict containing such) for a value lookup.
The logic is handled in a new name_or_id_clause() function, which is called several places to generate an appropriate query clause for the value to look up.
In the process, several functions were updated to avoid raw sql queries and numerous unit tests were added or updated.
This is a much more significant riff on PR #3118.
This change centralizes logic for accepting either name or id (or a dict containing such) for a value lookup.
The logic is handled in a new
name_or_id_clause()function, which is called several places to generate an appropriate query clause for the value to look up.In the process, several functions were updated to avoid raw sql queries and numerous unit tests were added or updated.
Fixes https://pagure.io/koji/issue/3122