Hello,
I've downloaded the last version of code and installed it on my server. Now, every time when Googlebot access my web, it access /matching_tags page and raises MultiValueDictKeyError. The whole traceback is here:
Traceback (most recent call last):
File ".../django/core/handlers/base.py", line 100, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File ".../osqa/forum/views/commands.py", line 513, in matching_tags
if len(request.GET['q']) == 0:
File ".../django/utils/datastructures.py", line 235, in __getitem__
raise MultiValueDictKeyError("Key %r not found in %r" % (key, self))
MultiValueDictKeyError: "Key 'q' not found in <QueryDict: {}>"
The problem is in forum/views/commands.py at line 513:
if len(request.GET['q']) == 0:
raise CommandException(_("Invalid request"))
If q is not in GET request, the exception is raised. In my opinion, this code is better:
if len(request.GET.get('q', '')) == 0:
raise CommandException(_("Invalid request"))
But there is still problem with unhandled exception in view. So I change code above to this:
if len(request.GET.get('q', '')) == 0:
return HttpResponseBadRequest("Invalid request")
Is there any official patch to this?
asked
03 Jun '11, 04:49
Vlastimil Sl...
31●1●1●4
accept rate:
0%
I have the same problem in logs, and + tags autocomplete doesn't work (I think these problems are connected).