google-code-export / django-page-cms

Automatically exported from code.google.com/p/django-page-cms
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

TypeError: coercing to Unicode: need string or buffer, NoneType found #146

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Getting a 500 only on pages that are routed to the page CMS that should
normally return a 404 (like /pages/fdsa) if "fdsa" is not a valid URL to a
page. Correct page-cms controlled pages are loading fine.

For some reason, I cannot replicate this issue on another machine, nor on
another Django site on the same server. I've been banging my head on this
for a few hours, so I figured I'd throw it up here in case someone else has
run into it before.

Thanks in advance. Traceback attached.

Original issue reported on code.google.com by intellin...@gmail.com on 14 Aug 2009 at 2:22

Attachments:

GoogleCodeExporter commented 9 years ago
On second thought, I think this is a bug in django-page-cms. On a fresh django
project, this bug surfaces.

It only appears on pages that *should* simply return a 404. Other page-cms 
controlled
pages function correctly.

The offending code appears to be:

   url = url + '?' + request.META["QUERY_STRING"]

Will see if I can dig a bit more and figure out what's going on.

Original comment by intellin...@gmail.com on 21 Aug 2009 at 8:13

GoogleCodeExporter commented 9 years ago
I just encountered this error after a fresh install of the 1.0.6 release.

The problem is that request.META["QUERY_STRING"] evaluates to None.

I fixed it by replacing this:

if ("QUERY_STRING" in request.META and
        request.META["QUERY_STRING"] != ""):
    url = url + '?' + request.META["QUERY_STRING"]

with this:

query = request.META.get('QUERY_STRING')
if query:
    url = url + '?' + query

Original comment by meye...@gmail.com on 22 Aug 2009 at 3:23

GoogleCodeExporter commented 9 years ago
Fixed in revision 656

Original comment by batiste....@gmail.com on 24 Aug 2009 at 11:12

GoogleCodeExporter commented 9 years ago
Awesome. Thanks so much.

Original comment by intellin...@gmail.com on 24 Aug 2009 at 2:31