def subscribe_to_exploration(user_id, exploration_id):
 subscriptions_model = user_models.UserSubscriptionsModel.get(user_id, strict=False)
 if (not subscriptions_model):
  subscriptions_model = user_models.UserSubscriptionsModel(id=user_id)
 if (exploration_id not in subscriptions_model.activity_ids):
  subscriptions_model.activity_ids.append(exploration_id)
  subscriptions_model.put()

def subscribe_to_exploration ( user_id , exploration_id ) : subscriptions_model = user_models . UserSubscriptionsModel . get ( user_id , strict = False ) if ( not subscriptions_model ) : subscriptions_model = user_models . UserSubscriptionsModel ( id = user_id ) if ( exploration_id not in subscriptions_model . activity_ids ) : subscriptions_model . activity_ids . append ( exploration_id ) subscriptions_model . put ( )
subscribes a user to an exploration .