From 8adf2a67294d5fb62ebbf0c5784192e23fa907bd Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Wed, 16 Aug 2017 11:29:32 +0200 Subject: [PATCH] Clear the identifier_number on identifier reset (fixes #3353) --- CHANGELOG | 1 + openslides/motions/models.py | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index e958831f1..ed628eb99 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -40,6 +40,7 @@ Motions: - Added inline Editing for motion reason [#3361]. - Added multiselect filter for motion comments [#3372]. - Added support for pinning personal notes to the window [#3360]. +- Clear identifier on state reset [#3356]. Elections: - Added pagination for list view [#3393]. diff --git a/openslides/motions/models.py b/openslides/motions/models.py index cddd9ca79..118a6ba67 100644 --- a/openslides/motions/models.py +++ b/openslides/motions/models.py @@ -581,13 +581,20 @@ class Motion(RESTModelMixin, models.Model): def reset_state(self, workflow=None): """ - Set the state to the default state. + Set the state to the default state. If an identifier was set + automatically, reset the identifier and identifier_number. 'workflow' can be a workflow, an id of a workflow or None. If the motion is new and workflow is None, it chooses the default workflow from config. """ + + # The identifier is set automatically. + if config['motions_identifier'] is not 'manually': + self.identifier = '' + self.identifier_number = None + if type(workflow) is int: workflow = Workflow.objects.get(pk=workflow)