def create_user_contributions(user_id, created_exploration_ids, edited_exploration_ids):
 user_contributions = get_user_contributions(user_id, strict=False)
 if user_contributions:
  raise Exception(('User contributions model for user %s already exists.' % user_id))
 else:
  user_contributions = UserContributions(user_id, created_exploration_ids, edited_exploration_ids)
  _save_user_contributions(user_contributions)
 return user_contributions

def create_user_contributions ( user_id , created_exploration_ids , edited_exploration_ids ) : user_contributions = get_user_contributions ( user_id , strict = False ) if user_contributions : raise Exception ( ( 'User contributions model for user %s already exists.' % user_id ) ) else : user_contributions = UserContributions ( user_id , created_exploration_ids , edited_exploration_ids ) _save_user_contributions ( user_contributions ) return user_contributions
creates a new usercontributionsmodel and returns the domain object .