From d78a7f91bc7ab4568476e8e437b9852996fa9b9c Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Thu, 13 Apr 2017 10:41:13 +0200 Subject: [PATCH] Fix clearing empty chat messages (fixes #3192) --- CHANGELOG | 3 ++- openslides/core/views.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 3e023d9fe..08f9d2d51 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -22,7 +22,8 @@ Motions: Core: - No reload on logoff. OpenSlides is now a full single page application [#3172]. -- Adding support for choosing image files as logos. +- Adding support for choosing image files as logos [#3184]. +- Fixing error when clearing empty chat [#3199]. Users: - User without permission to see users can now see agenda item speakers, diff --git a/openslides/core/views.py b/openslides/core/views.py index 250d76019..5b09cff78 100644 --- a/openslides/core/views.py +++ b/openslides/core/views.py @@ -737,7 +737,8 @@ class ChatMessageViewSet(ModelViewSet): args.append(chatmessage.pk) chatmessages.delete() # Trigger autoupdate and setup response. - inform_deleted_data(*args) + if len(args) > 0: + inform_deleted_data(*args) return Response({'detail': _('All chat messages deleted successfully.')})