diff --git a/bothub/api/grpc/organization/serializers.py b/bothub/api/grpc/organization/serializers.py index e46063df..cbd21f29 100644 --- a/bothub/api/grpc/organization/serializers.py +++ b/bothub/api/grpc/organization/serializers.py @@ -35,6 +35,7 @@ class Meta: class OrgCreateProtoSerializer(proto_serializers.ModelProtoSerializer): + organization_name = serializers.CharField() user_email = serializers.CharField() user_nickname = serializers.CharField() @@ -49,7 +50,7 @@ def validate_user_email(self, value: str) -> str: class Meta: model = Organization proto_class = organization_pb2.Org - fields = ["name", "user_email", "user_nickname"] + fields = ["organization_name", "user_email", "user_nickname"] class OrgUpdateProtoSerializer(proto_serializers.ModelProtoSerializer): diff --git a/bothub/api/grpc/organization/services.py b/bothub/api/grpc/organization/services.py index 7ea1b918..7dbba66f 100644 --- a/bothub/api/grpc/organization/services.py +++ b/bothub/api/grpc/organization/services.py @@ -20,7 +20,12 @@ class OrgService( - mixins.ListModelMixin, mixins.RetrieveModelMixin, generics.GenericService + mixins.ListModelMixin, + mixins.RetrieveModelMixin, + mixins.CreateModelMixin, + mixins.UpdateModelMixin, + mixins.DestroyModelMixin, + generics.GenericService, ): def List(self, request, context): @@ -40,9 +45,9 @@ def Create(self, request, context): serializer.is_valid(raise_exception=True) validated_data = { - "name": serializer.validated_data.get("name"), + "name": serializer.validated_data.get("organization_name"), "nickname": utils.organization_unique_slug_generator( - serializer.validated_data.get("name") + serializer.validated_data.get("organization_name") ), "description": "", "locale": "", diff --git a/bothub/protos/organization.proto b/bothub/protos/organization.proto index 9fa4d185..f7c4e414 100644 --- a/bothub/protos/organization.proto +++ b/bothub/protos/organization.proto @@ -6,10 +6,10 @@ import "google/protobuf/empty.proto"; service OrgController { rpc List(OrgListRequest) returns (stream Org) {} - rpc Retrieve(OrgStatisticRetrieveRequest) returns (OrgStatistic) {} rpc Create(OrgCreateRequest) returns (Org) {} rpc Update(OrgUpdateRequest) returns (OrgUpdateRequest) {} rpc Destroy(OrgDestroyRequest) returns (google.protobuf.Empty) {} + rpc Retrieve(OrgStatisticRetrieveRequest) returns (OrgStatistic) {} } message Org { @@ -30,7 +30,7 @@ message OrgListRequest { } message OrgCreateRequest { - string name = 1; + string organization_name = 1; string user_email = 2; string user_nickname = 3; }