def subscribe_to_thread(user_id, feedback_thread_id):
 subscriptions_model = user_models.UserSubscriptionsModel.get(user_id, strict=False)
 if (not subscriptions_model):
  subscriptions_model = user_models.UserSubscriptionsModel(id=user_id)
 if (feedback_thread_id not in subscriptions_model.feedback_thread_ids):
  subscriptions_model.feedback_thread_ids.append(feedback_thread_id)
  subscriptions_model.put()

def subscribe_to_thread ( user_id , feedback_thread_id ) : subscriptions_model = user_models . UserSubscriptionsModel . get ( user_id , strict = False ) if ( not subscriptions_model ) : subscriptions_model = user_models . UserSubscriptionsModel ( id = user_id ) if ( feedback_thread_id not in subscriptions_model . feedback_thread_ids ) : subscriptions_model . feedback_thread_ids . append ( feedback_thread_id ) subscriptions_model . put ( )
subscribes a user to a feedback thread .