Merge pull request #4153 from normanjaeckel/RecExtension

Fixed following recommendations with extensions.
This commit is contained in:
Emanuel Schütze 2019-01-20 10:21:56 +01:00 committed by GitHub
commit 33d9468e6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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:
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).

View File

@ -827,13 +827,7 @@ class MotionViewSet(ModelViewSet):
if motion.recommendation is None:
raise ValidationError({"detail": "Cannot set an empty recommendation."})
# Set state.
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
motion.follow_recommendation()
# Save and write log.
motion.save(