mirror of https://github.com/zulip/zulip.git
4c0890e8b0
We recently received a bug report that implied that for certain payloads, the `requested_reviewers` key was empty whereas a singular `requested_reviewer` key containing one reviewer's information was present in its stead. Naturally, this raised some not so pretty IndexError exceptions. After some investigation and generating a few similar payloads, I discovered that in every case both the `requested_reviewers` and the `requested_reviewer` keys were correctly populated, so I had to manually edit the payload to reproduce the error on my end. My guess is that this anomaly goes back to when GitHub's reviewer request feature was new and didn't support requesting multiple reviewers, and that the singular `requested_reviewer` key could possibly just be there for backwards compatibility or might just be mere oversight. Either way, the solution here is to look for the plural `requested_reviewers` key, and if that is empty, fall back to the singular `requested_reviewer` key. |
||
---|---|---|
.. | ||
fixtures | ||
__init__.py | ||
doc.md | ||
tests.py | ||
view.py |