Fixed English strings concerning agenda items and organizational items and their relation. Fixed #1271.
This commit is contained in:
parent
8b2723e846
commit
ee82c2c105
@ -128,9 +128,9 @@ class Item(SlideMixin, AbsoluteUrlMixin, MPTTModel):
|
|||||||
Ensures that the children of orga items are only orga items.
|
Ensures that the children of orga items are only orga items.
|
||||||
"""
|
"""
|
||||||
if self.type == self.AGENDA_ITEM and self.parent is not None and self.parent.type == self.ORGANIZATIONAL_ITEM:
|
if self.type == self.AGENDA_ITEM and self.parent is not None and self.parent.type == self.ORGANIZATIONAL_ITEM:
|
||||||
raise ValidationError(_('Agenda items can not be descendents of an organizational item.'))
|
raise ValidationError(_('Agenda items can not be child elements of an organizational item.'))
|
||||||
if self.type == self.ORGANIZATIONAL_ITEM and self.get_descendants().filter(type=self.AGENDA_ITEM).exists():
|
if self.type == self.ORGANIZATIONAL_ITEM and self.get_descendants().filter(type=self.AGENDA_ITEM).exists():
|
||||||
raise ValidationError(_('Organizational items can not have agenda items as descendents.'))
|
raise ValidationError(_('Organizational items can not have agenda items as child elements.'))
|
||||||
return super(Item, self).clean()
|
return super(Item, self).clean()
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
|
@ -139,7 +139,7 @@ class Overview(TemplateView):
|
|||||||
if item.type == item.AGENDA_ITEM and parent.type == item.ORGANIZATIONAL_ITEM:
|
if item.type == item.AGENDA_ITEM and parent.type == item.ORGANIZATIONAL_ITEM:
|
||||||
transaction.rollback()
|
transaction.rollback()
|
||||||
messages.error(
|
messages.error(
|
||||||
request, _('Agenda items can not be descendents of an organizational item.'))
|
request, _('Agenda items can not be child elements of an organizational item.'))
|
||||||
break
|
break
|
||||||
item.parent = parent
|
item.parent = parent
|
||||||
item.weight = form.cleaned_data['weight']
|
item.weight = form.cleaned_data['weight']
|
||||||
|
@ -241,7 +241,7 @@ class ViewTest(TestCase):
|
|||||||
'i2-parent': 1}
|
'i2-parent': 1}
|
||||||
response = self.adminClient.post('/agenda/', data)
|
response = self.adminClient.post('/agenda/', data)
|
||||||
self.assertNotEqual(Item.objects.get(pk=2).parent_id, 1)
|
self.assertNotEqual(Item.objects.get(pk=2).parent_id, 1)
|
||||||
self.assertContains(response, 'Agenda items can not be descendents of an organizational item.')
|
self.assertContains(response, 'Agenda items can not be child elements of an organizational item.')
|
||||||
|
|
||||||
def test_delete(self):
|
def test_delete(self):
|
||||||
response = self.adminClient.get('/agenda/%s/del/' % self.item1.pk)
|
response = self.adminClient.get('/agenda/%s/del/' % self.item1.pk)
|
||||||
@ -301,7 +301,7 @@ class ViewTest(TestCase):
|
|||||||
response,
|
response,
|
||||||
'form',
|
'form',
|
||||||
None,
|
None,
|
||||||
'Agenda items can not be descendents of an organizational item.')
|
'Agenda items can not be child elements of an organizational item.')
|
||||||
|
|
||||||
def test_orga_item_with_orga_parent_two(self):
|
def test_orga_item_with_orga_parent_two(self):
|
||||||
item1 = Item.objects.create(title='item1_aeNg4Heibee8ULooneep')
|
item1 = Item.objects.create(title='item1_aeNg4Heibee8ULooneep')
|
||||||
@ -314,7 +314,7 @@ class ViewTest(TestCase):
|
|||||||
response,
|
response,
|
||||||
'form',
|
'form',
|
||||||
None,
|
None,
|
||||||
'Organizational items can not have agenda items as descendents.')
|
'Organizational items can not have agenda items as child elements.')
|
||||||
|
|
||||||
def test_csv_import(self):
|
def test_csv_import(self):
|
||||||
item_number = Item.objects.all().count()
|
item_number = Item.objects.all().count()
|
||||||
|
Loading…
Reference in New Issue
Block a user