Merge pull request #4448 from normanjaeckel/SetStateView
Set state view
This commit is contained in:
commit
4174f70d2b
@ -666,18 +666,17 @@ 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.
|
||||
if not state.dont_set_identifier:
|
||||
motion.save(
|
||||
update_fields=["state", "last_modified", "identifier"],
|
||||
update_fields=[
|
||||
"state",
|
||||
"identifier",
|
||||
"identifier_number",
|
||||
"last_modified",
|
||||
],
|
||||
skip_autoupdate=True,
|
||||
)
|
||||
else:
|
||||
motion.save(
|
||||
update_fields=["state", "last_modified"], skip_autoupdate=True
|
||||
)
|
||||
|
||||
# Write the log message.
|
||||
motion.write_log(
|
||||
|
Loading…
Reference in New Issue
Block a user