From e870ed495a7692bb932d8feede8253fbd6fa3e01 Mon Sep 17 00:00:00 2001 From: Maximilian Krambach Date: Wed, 27 Feb 2019 17:50:22 +0100 Subject: [PATCH] fix identifier setting on mass setstate --- openslides/motions/views.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/openslides/motions/views.py b/openslides/motions/views.py index 135873aa8..3c10d7304 100644 --- a/openslides/motions/views.py +++ b/openslides/motions/views.py @@ -666,9 +666,18 @@ class MotionViewSet(ModelViewSet): {"detail": f"You can not set the state to {state_id}."} ) motion.set_state(state_id) + state = State.objects.get(pk=state_id) # Save motion. - motion.save(update_fields=["state", "last_modified"], skip_autoupdate=True) + if not state.dont_set_identifier: + motion.save( + update_fields=["state", "last_modified", "identifier"], + skip_autoupdate=True, + ) + else: + motion.save( + update_fields=["state", "last_modified"], skip_autoupdate=True + ) # Write the log message. motion.write_log(