openslides_backend/action/actions/motion/follow_recommendation.py
def update_instance(self, instance: Dict[str, Any]) -> Dict[str, Any]:
        """
        If motion has a recommendation_id, set the state to it and
        set state_extension.
        """
        recommendation_id = instance.pop("recommendation_id")
        instance["state_id"] = recommendation_id
        instance = super().update_instance(instance)
        recommendation = self.datastore.get(
            FullQualifiedId(Collection("motion_state"), recommendation_id),
            ["show_state_extension_field", "show_recommendation_extension_field"],
        )
        recommendation_extension = instance.pop("recommendation_extension", None)
        if (
            recommendation_extension is not None
            and recommendation.get("show_state_extension_field")
            and recommendation.get("show_recommendation_extension_field")
        ):
            instance["state_extension"] = recommendation_extension
        instance["last_modified"] = round(time.time())
        return instance

        If motion has a recommendation_id, set the state to it and
        set state_extension.
        
If motion has a recommendation_id, set the state to it and
set state_extension.
If motion has a recommendation_id set the state to it and set state_extension .
def update_instance(self, instance: Dict[str, Any]) -> Dict[str, Any]:
        recommendation_id = instance.pop("recommendation_id")
        instance["state_id"] = recommendation_id
        instance = super().update_instance(instance)
        recommendation = self.datastore.get(
            FullQualifiedId(Collection("motion_state"), recommendation_id),
            ["show_state_extension_field", "show_recommendation_extension_field"],
        )
        recommendation_extension = instance.pop("recommendation_extension", None)
        if (
            recommendation_extension is not None
            and recommendation.get("show_state_extension_field")
            and recommendation.get("show_recommendation_extension_field")
        ):
            instance["state_extension"] = recommendation_extension
        instance["last_modified"] = round(time.time())
        return instance
def update_instance ( self , instance : Dict [ str , Any ] ) -> Dict [ str , Any ] : recommendation_id = instance . pop ( "recommendation_id" ) instance [ "state_id" ] = recommendation_id instance = super ( ) . update_instance ( instance ) recommendation = self . datastore . get ( FullQualifiedId ( Collection ( "motion_state" ) , recommendation_id ) , [ "show_state_extension_field" , "show_recommendation_extension_field" ] , ) recommendation_extension = instance . pop ( "recommendation_extension" , None ) if ( recommendation_extension is not None and recommendation . get ( "show_state_extension_field" ) and recommendation . get ( "show_recommendation_extension_field" ) ) : instance [ "state_extension" ] = recommendation_extension instance [ "last_modified" ] = round ( time . time ( ) ) return instance
If motion has a recommendation_id, set the state to it and
set state_extension.
If motion has a recommendation_id set the state to it and set state_extension .
"""
        If motion has a recommendation_id, set the state to it and
        set state_extension.
        """
self
instance
Dict[str, Any]