views: comments: moderation: Check value earlier (#799)
views: comments: moderation: Check value earlier (#799)

The item check should happen before we try to access
the value not after otherwise it results in a backtracke like this:

gunicorn[441]: 2022-02-17 20:46:52,526 ERROR: GET /id/2038/delete/XXXXXXXXXXXX
gunicorn[441]: Traceback (most recent call last):
gunicorn[441]:   File "/opt/isso/lib/python3.6/site-packages/isso/__init__.py", line 150, in dispatch
gunicorn[441]:     response = handler(request.environ, request, **values)
gunicorn[441]:   File "/opt/isso/lib/python3.6/site-packages/isso/views/comments.py", line 635, in moderate
gunicorn[441]:     thread = self.threads.get(item['tid'])
gunicorn[441]: TypeError: 'NoneType' object is not subscriptable

Now we return a item NotFound instead.

Signed-off-by: fliiiix <c22b5f9178342609428d6f51b2c5af4c0bde6a42@l33t.name>
posativ/isso,posativ/isso,posativ/isso,posativ/isso