diff --git a/openslides/participant/models.py b/openslides/participant/models.py index c48cf1e3d..448ea828e 100644 --- a/openslides/participant/models.py +++ b/openslides/participant/models.py @@ -139,7 +139,7 @@ class Group(PersonMixin, Person, SlideMixin, DjangoGroup): description = models.TextField(blank=True, verbose_name=ugettext_lazy("Description")) @models.permalink - def get_absolute_url(self, link='view'): + def get_absolute_url(self, link='detail'): """ Return the URL to this user group. @@ -148,7 +148,7 @@ class Group(PersonMixin, Person, SlideMixin, DjangoGroup): * edit * delete """ - if link == 'view': + if link == 'detail' or link == 'view': return ('user_group_view', [str(self.id)]) if link == 'edit': return ('user_group_edit', [str(self.id)]) diff --git a/tests/agenda/test_list_of_speakers.py b/tests/agenda/test_list_of_speakers.py index b8e93c7df..a1dd79aaa 100644 --- a/tests/agenda/test_list_of_speakers.py +++ b/tests/agenda/test_list_of_speakers.py @@ -11,7 +11,7 @@ from django.test.client import Client from openslides.utils.exceptions import OpenSlidesError from openslides.utils.test import TestCase -from openslides.participant.models import User +from openslides.participant.models import User, Group from openslides.agenda.models import Item, Speaker from openslides.config.api import config @@ -143,6 +143,15 @@ class TestAgendaItemView(SpeakerViewTestCase): '/agenda/1/', {'speaker': self.speaker1.person_id}) self.assertFormError(response, 'form', 'speaker', 'speaker1 is already on the list of speakers.') + def test_group_as_speaker(self): + """ + Test to show a group as a speaker on the agenda-view. + """ + group = Group.objects.create(name='test', group_as_person=True) + Speaker.objects.add(group, self.item1) + self.assertTrue(Speaker.objects.filter(person=group.person_id, item=self.item1).exists()) + response = self.admin_client.get('/agenda/1/') + class TestSpeakerDeleteView(SpeakerViewTestCase): def test_get(self):