user.save() # Even with the uuid part, usernames are not guaranteed to be unique, # in this case, just ignore and continue except IntegrityError as e: continue if gym_list: gym_id = random.choice(gym_list) user.userprofile.gym_id = gym_id user.userprofile.gender = '1' if gender == 'm' else 2 user.userprofile.age = random.randint(18, 45) user.userprofile.save() config = GymUserConfig() config.gym_id = gym_id config.user = user config.save() print(' - {0}, {1}'.format(name, surname)) # # Gym generator # if hasattr(args, 'number_gyms'): print("** Generating {0} gyms".format(args.number_gyms)) gym_list = [] names_part1 = [] names_part2 = []
user.last_name = surname user.save() # Even with the uuid part, usernames are not guaranteed to be unique, # in this case, just ignore and continue except IntegrityError as e: continue if gym_list: gym_id = random.choice(gym_list) user.userprofile.gym_id = gym_id user.userprofile.gender = '1' if gender == 'm' else 2 user.userprofile.save() config = GymUserConfig() config.gym_id = gym_id config.user = user config.save() print(' - {0}, {1}'.format(name, surname)) # # Gym generator # if hasattr(args, 'number_gyms'): print("** Generating {0} gyms".format(args.number_gyms)) gym_list = [] names_part1 = [] names_part2 = []