From 7624dc67af82732e447bb597761e63db854e5122 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norman=20J=C3=A4ckel?= Date: Fri, 31 May 2013 14:00:24 +0200 Subject: [PATCH] Fixed #687 --- openslides/account/views.py | 4 ++-- tests/account/test_widgets.py | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/openslides/account/views.py b/openslides/account/views.py index cbe6af490..9d83be68a 100644 --- a/openslides/account/views.py +++ b/openslides/account/views.py @@ -51,9 +51,9 @@ def get_personal_info_widget(request): pass else: personal_info_context.update({ - 'submitted_motions': Motion.objects.filter(submitter=request.user), + 'submitted_motions': Motion.objects.filter(submitter__person=request.user), 'config_motion_min_supporters': config['motion_min_supporters'], - 'supported_motions': Motion.objects.filter(supporter=request.user)}) + 'supported_motions': Motion.objects.filter(supporter__person=request.user)}) try: from openslides.assignment.models import Assignment except ImportError: diff --git a/tests/account/test_widgets.py b/tests/account/test_widgets.py index 5b22a3f40..ba39d666a 100644 --- a/tests/account/test_widgets.py +++ b/tests/account/test_widgets.py @@ -78,20 +78,26 @@ class PersonalInfoWidget(TestCase): motion = self.import_motion() if motion: motion_1 = motion.models.Motion.objects.create(title='My Motion Title pa8aeNohYai0ahge', text='My Motion Text') + motion_2 = motion.models.Motion.objects.create(title='My Motion Title quielohL7vah1weochai', text='My Motion Text') submitter_1 = motion.models.MotionSubmitter.objects.create(motion=motion_1, person=self.user) + submitter_2 = motion.models.MotionSubmitter.objects.create(motion=motion_2, person=self.user) response = self.client.get('/projector/dashboard/') self.assertContains(response, 'I submitted the following motions:', status_code=200) self.assertContains(response, 'My Motion Title pa8aeNohYai0ahge', status_code=200) + self.assertContains(response, 'My Motion Title quielohL7vah1weochai', status_code=200) def test_supporter_list(self): motion = self.import_motion() if motion: - motion_1 = motion.models.Motion.objects.create(title='My Motion Title pa8aeNohYai0ahge', text='My Motion Text') + motion_1 = motion.models.Motion.objects.create(title='My Motion Title jahN9phaiThae5ooKubu', text='My Motion Text') + motion_2 = motion.models.Motion.objects.create(title='My Motion Title vech9ash8aeh9eej2Ga2', text='My Motion Text') supporter_1 = motion.models.MotionSupporter.objects.create(motion=motion_1, person=self.user) + supporter_2 = motion.models.MotionSupporter.objects.create(motion=motion_2, person=self.user) config['motion_min_supporters'] = 1 response = self.client.get('/projector/dashboard/') self.assertContains(response, 'I support the following motions:', status_code=200) - self.assertContains(response, 'My Motion Title pa8aeNohYai0ahge', status_code=200) + self.assertContains(response, 'My Motion Title jahN9phaiThae5ooKubu', status_code=200) + self.assertContains(response, 'My Motion Title vech9ash8aeh9eej2Ga2', status_code=200) def test_candidate_list(self): assignment = self.import_assignment()