Sphene Community Tools

Community

Copyright © 2007-2018 by Herbert Poul

You are not logged in.
Login
Register

Change Language:



AddThis Social Bookmark Button

A Django site.

Powered by Sphene Community Tools
Board » General » Error "WSGIRequest' object is unsubscriptable" with its solution

Hi,

I found this error trying to change the Thread Options (Make Sticky, Lock Thread, Move Thread)

I found and applied the solution at this address: http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges#Removeddictionaryaccesstorequestobject

The problem was the function 'options' in the file communitytools/sphenecoll/sphene/sphboard/views.py

I juste changed
request['cmd'] by request.REQUEST['cmd']

The new version is:
def options(request, thread_id, group = None):
    thread = Post.objects.get( pk = thread_id )

    if request.REQUEST['cmd'] == 'makeSticky':
        thread.set_sticky(True)
    elif request.REQUEST['cmd'] == 'removeSticky':
        thread.set_sticky(False)
    elif request.REQUEST['cmd'] == 'toggleClosed':
        thread.set_closed(not thread.is_closed())
    elif request.REQUEST['cmd'] == 'modifytags':
        from tagging.models import Tag
        Tag.objects.update_tags( thread.get_threadinformation(), [request.POST['tags'], ] )

    thread.save()
    
    return HttpResponseRedirect( '../../thread/%s/' % thread.id )


Kindly regards

--- Last Edited by manolito at 2008-11-22 17:56:25 ---
hi,
thanks for your post.. but i think it is already fixed in the trunk: http://yourhell.com/svn/root/django/communitytools/trunk/sphenecoll/sphene/sphboard/views.py - this already contains the described fixed ?

(sorry for the late reply, i was away for a few days)
Hey, we have Signatures !!! Great, isn't it ? ;)

Please login to post a reply.



Powered by Sphene Community Tools