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%20Slint%C3%A1k's gravatar image

Vlastimil Sl...
31114
accept rate: 0%

edited 03 Jun '11, 05:16

Andrew_S's gravatar image

Andrew_S ♦
5.6k45674

I have the same problem in logs, and + tags autocomplete doesn't work (I think these problems are connected).

(09 Mar, 00:58) egorych
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×6
×1

Asked: 03 Jun '11, 04:49

Seen: 250 times

Last updated: 09 Mar, 00:58

powered by OSQA