Fixed following recommendations with extensions.

This commit is contained in:
Norman Jäckel 2019-01-19 22:36:31 +01:00
parent 12c6554064
commit 7c6e98fae6
2 changed files with 5 additions and 7 deletions

View File

@ -507,6 +507,10 @@ class Motion(RESTModelMixin, models.Model):
""" """
if self.recommendation is not None: if self.recommendation is not None:
self.set_state(self.recommendation) self.set_state(self.recommendation)
if (self.recommendation_extension is not None
and self.state.show_state_extension_field
and self.recommendation.show_recommendation_extension_field):
self.state_extension = self.recommendation_extension
""" """
Container for runtime information for agenda app (on create or update of this instance). Container for runtime information for agenda app (on create or update of this instance).

View File

@ -827,13 +827,7 @@ class MotionViewSet(ModelViewSet):
if motion.recommendation is None: if motion.recommendation is None:
raise ValidationError({"detail": "Cannot set an empty recommendation."}) raise ValidationError({"detail": "Cannot set an empty recommendation."})
# Set state. motion.follow_recommendation()
motion.set_state(motion.recommendation)
# Set the special state comment.
extension = request.data.get("state_extension")
if extension is not None:
motion.state_extension = extension
# Save and write log. # Save and write log.
motion.save( motion.save(