Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Adding E-Commerce rule to show help bot chat #892

Merged
merged 1 commit into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion connect/api/v1/organization/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ def get_authorization(self, obj):
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
user = obj.authorizations.order_by("created_at").first().user
return user.number_people == 4 or user.company_segment in ['E-commerce', 'Comercio electrónico']


class OrganizationAuthorizationSerializer(serializers.ModelSerializer):
Expand Down
3 changes: 2 additions & 1 deletion connect/api/v2/organizations/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ def publish_create_org_message(self, instance: Organization, user: User):
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
user = obj.authorizations.order_by("created_at").first().user
return user.number_people == 4 or user.company_segment in ['E-commerce', 'Comercio electrónico']


class PendingAuthorizationOrganizationSerializer(serializers.ModelSerializer):
Expand Down
Loading