Update error message in make task when channel not exist

Fixes: https://pagure.io/koji/issue/3125
This commit is contained in:
Jana Cupova 2021-11-11 09:52:58 +01:00 committed by Tomas Kopecek
parent ab87d70d55
commit 4f2506cc81

View file

@ -569,7 +569,9 @@ def make_task(method, arglist, **opts):
policy_data['user_id'] = opts['owner']
if 'channel' in opts:
policy_data['req_channel'] = opts['channel']
channel_info = get_channel(opts['channel'], strict=True)
channel_info = get_channel(opts['channel'])
if not channel_info:
raise koji.GenericError('No such channel: %s' % opts['channel'])
if channel_info['enabled']:
req_channel_id = channel_info['id']
else: