e-hulp/HelpIM — Issue #169: Internal server error in /admin/conversations/conversation/76/
Author: winfried
Created: 2012-02-23 13:35:52+00:00
State: open
Labels: bug, django, Medium priority

Situation: Customer has users, a branch office defined, but none of the users are member of a branch office (the field says '----'). Users who have superuser status, can see all chatlogs. Users who are not superuser, but have the permissions of seeing all chats from all branch offices or all chats of own branch office, get the internal server error below:

Traceback (most recent call last):

File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)

File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/options.py", line 307, in wrapper
return self.admin_site.admin_view(view)(*args, **kwargs)

File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py", line 93, in _wrapped_view
response = view_func(request, *args, **kwargs)

File "/usr/local/lib/python2.6/dist-packages/django/views/decorators/cache.py", line 79, in _wrapped_view_func
response = view_func(request, *args, **kwargs)

File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/sites.py", line 197, in inner
return view(request, *args, **kwargs)

File "/usr/local/lib/python2.6/dist-packages/helpim/conversations/admin.py", line 193, in change_view
return super(ConversationAdmin, self).change_view(request, object_id, extra_context=questionnaire_context)

File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py", line 28, in _wrapper
return bound_func(*args, **kwargs)

File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py", line 93, in _wrapped_view
response = view_func(request, *args, **kwargs)

File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py", line 24, in bound_func
return func(self, *args2, **kwargs2)

File "/usr/local/lib/python2.6/dist-packages/django/db/transaction.py", line 217, in inner
res = func(*args, **kwargs)

File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/options.py", line 947, in change_view
obj = self.get_object(request, unquote(object_id))

File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/options.py", line 451, in get_object
return queryset.get(pk=object_id)

File "/usr/local/lib/python2.6/dist-packages/django/db/models/query.py", line 351, in get
% (self.model._meta.object_name, num, kwargs))

MultipleObjectsReturned: get() returned more than one Conversation -- it returned 2! Lookup parameters were {'pk': 76}