Consider the following summary of a review request:
Container Review Request - python-classroom - Container for teaching and learning Python
Note that it has no :, but it has 2 '-'.
:
The code in pkgdb2/api/extras.py api_pkgrequest() does the following:
pkgdb2/api/extras.py
api_pkgrequest()
tmp = bug.summary.partition(':')[2] if not tmp: httpcode = 400 output['output'] = 'notok' output['error'] = 'Invalid title for this bugzilla ticket (no ":" '\ 'present)' # Check the format of the title if not ' - ' in tmp: httpcode = 400 output['output'] = 'notok' output['error'] = 'Invalid title for this bugzilla ticket (no "-" '\ 'present)'
In our case tmp gets set to an empty string '' and the first if will happen setting the error message to the correct thing ('Invalid title for this bugzilla ticket (no ":" present)').
tmp
''
if
'Invalid title for this bugzilla ticket (no ":" present)'
However, the second if will happen as well changing the error message to incorrect '...(no "-" present)'.
'...(no "-" present)'
The second if has to be guarded (it has to check if tmp is True as well). Will send a PR.
True
https://pagure.io/pkgdb2/pull-request/63
Login to comment on this ticket.