def update_user_contributions(user_id, created_exploration_ids, edited_exploration_ids):
 user_contributions = get_user_contributions(user_id, strict=False)
 if (not user_contributions):
  raise Exception(('User contributions model for user %s does not exist.' % user_id))
 user_contributions.created_exploration_ids = created_exploration_ids
 user_contributions.edited_exploration_ids = edited_exploration_ids
 _save_user_contributions(user_contributions)

def update_user_contributions ( user_id , created_exploration_ids , edited_exploration_ids ) : user_contributions = get_user_contributions ( user_id , strict = False ) if ( not user_contributions ) : raise Exception ( ( 'User contributions model for user %s does not exist.' % user_id ) ) user_contributions . created_exploration_ids = created_exploration_ids user_contributions . edited_exploration_ids = edited_exploration_ids _save_user_contributions ( user_contributions )
updates an existing usercontributionsmodel with new calculated contributions .