diff --git a/openslides/agenda/api.py b/openslides/agenda/api.py index af90dcc6f..3c0b86ba0 100644 --- a/openslides/agenda/api.py +++ b/openslides/agenda/api.py @@ -58,10 +58,16 @@ def children_list(items): l += children_list(item.children) return l -def gen_confirm_form_for_items(request, message, url): - messages.warning(request, '%s
' % (message, url, csrf(request)['csrf_token'], _("Yes"), _("Yes, with all child items."), _("No"))) +def gen_confirm_form_for_items(request, message, url, singleitem=None): + if singleitem: + messages.warning(request, '%s' % (message, url, csrf(request)['csrf_token'], _("Yes"), _("No"))) + else: + messages.warning(request, '%s' % (message, url, csrf(request)['csrf_token'], _("Yes"), _("Yes, with all child items."), _("No"))) def del_confirm_form_for_items(request, object, name=None): if name is None: name = object - gen_confirm_form_for_items(request, _('Do you really want to delete %s?') % name, object.get_absolute_url('delete')) + if object.children: + gen_confirm_form_for_items(request, _('Do you really want to delete %s?') % name, object.get_absolute_url('delete'), False) + else: + gen_confirm_form_for_items(request, _('Do you really want to delete %s?') % name, object.get_absolute_url('delete'), True) \ No newline at end of file