def validate_rolls(self, rolls): """Make sure incoming rolls arrays are good""" # create a game object which won't be saved to the database # so we can check that our rolls list is valid test_game = Game(name="test_game", _rolls='[]') try: for roll in rolls: test_game.add_roll(roll) except: raise serializers.ValidationError("Rolls list was invald") return rolls