| Issue 74: | If a forum has multiple groups assigned to it managers.ForumManager.for_groups returns an instance of the forum for each group that has access. This causes the views.forum to raise a MultipleObjectsReturned | |
| 1 person starred this issue and may be notified of changes. | Back to list |
What steps will reproduce the problem? 1. Create a forum 2. Assign access to multiple groups 3. Visit forum list ( should see an instance of the forum for each group that has access ) 4. click on one of the returned forums and a MultipleObjectsReturned exception should be raised What is the expected output? What do you see instead? I would expect that if a user has access to a forum, then only one instance of the forum is return. What version of the product are you using? On what operating system? OS : OSX 10.5.7 Python : Python 2.5.1 (r251:54863, Feb 6 2009, 19:02:12) Django : Django version 1.1 SVN-11385 forum : ( was revsion 45, but I customised it locally as I needed to deploy it with 1.1 before the recent updates to the project. Please provide any additional information below. The fix is quite simple .. >>> change line 9 managers.py from return self.filter(public|user_groups) >>> to return self.filter(public|user_groups).distinct() Apologies about not submitting a proper patch - I don't know how to yet!
Aug 12, 2009
Hi! To submit a patch it's just: $ diff -Naur old_file new_file > file.patch That's it!
Aug 12, 2009
Thanks! Patch Attached. |
3.7 KB Download