def create(self, validated_data): _id = validated_data.pop('id') team = validated_data.pop('team', []) user = self.context['request'].user with transaction.atomic(): instance = create_new_course(user, _id['org'], _id['course'], _id['run'], validated_data) self.update_team(instance, team) return instance
def create(self, validated_data): _id = validated_data.pop('id') team = validated_data.pop('team', []) user = self.context['request'].user with transaction.atomic(): instance = create_new_course(user, _id['org'], _id['course'], _id['run'], validated_data) self.update_team(instance, team) return instance