diff --git a/connect/api/v1/organization/serializers.py b/connect/api/v1/organization/serializers.py index 49eb91bc..aa7bdcdf 100644 --- a/connect/api/v1/organization/serializers.py +++ b/connect/api/v1/organization/serializers.py @@ -115,7 +115,8 @@ class Meta: "created_at", "is_suspended", "extra_integration", - "enforce_2fa" + "enforce_2fa", + "show_chat_help", ] ref_name = None @@ -145,6 +146,8 @@ class Meta: help_text=_("if this field is true, only users with 2fa activated can access the org") ) + show_chat_help = serializers.SerializerMethodField() + def create_organization(self, validated_data): # pragma: no cover organization = {"id": 0} if not settings.TESTING: @@ -236,6 +239,11 @@ def get_authorization(self, obj): ).data return data + def get_show_chat_help(self, obj): + if obj.config.get("show_chat_help"): + return True + return obj.authorizations.order_by("created_at").first().user.number_people == 4 + class OrganizationAuthorizationSerializer(serializers.ModelSerializer): class Meta: