Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

support: Show role of the user in search result.

Vishnu KS38e7903425f7
diff --git a/analytics/tests/test_views.py b/analytics/tests/test_views.py
index 33c37c3bf3b..b4d87a6e4fb 100644
--- a/analytics/tests/test_views.py
+++ b/analytics/tests/test_views.py
@@ -579,6 +579,7 @@ class TestSupportEndpoint(ZulipTestCase):
"<h3>King Hamlet</h3>",
"<b>Email</b>: [email protected]",
"<b>Is active</b>: True<br>",
+ "<b>Role</b>: Member<br>",
'class="copy-button" data-copytext="[email protected], [email protected]"',
],
@@ -592,6 +593,18 @@ class TestSupportEndpoint(ZulipTestCase):
"<h3>Othello, the Moor of Venice</h3>",
"<b>Email</b>: [email protected]",
"<b>Is active</b>: True<br>",
+ "<b>Role</b>: Member<br>",
+ ],
+ result,
+ )
+
+ def check_polonius_user_query_result(result: HttpResponse) -> None:
+ self.assert_in_success_response(
+ [
+ "<h3>Polonius</h3>",
+ "<b>Email</b>: [email protected]",
+ "<b>Is active</b>: True<br>",
+ "<b>Role</b>: Guest<br>",
],
result,
)
@@ -731,6 +744,10 @@ class TestSupportEndpoint(ZulipTestCase):
check_hamlet_user_query_result(result)
check_zulip_realm_query_result(result)
+ result = self.client_get("/activity/support", {"q": self.example_email("polonius")})
+ check_polonius_user_query_result(result)
+ check_zulip_realm_query_result(result)
+
result = self.client_get("/activity/support", {"q": "lear"})
check_lear_realm_query_result(result)
diff --git a/templates/analytics/support.html b/templates/analytics/support.html
index 477080fb225..ea7b9aae51a 100644
--- a/templates/analytics/support.html
+++ b/templates/analytics/support.html
@@ -40,7 +40,7 @@
<b>Email</b>: {{ user.email }}<br>
<b>Date joined</b>: {{ user.date_joined|timesince }} ago<br>
<b>Is active</b>: {{ user.is_active }}<br>
- <b>Is admin</b>: {{ user.is_realm_admin }}<br>
+ <b>Role</b>: {{ user.get_role_name() }}<br>
<hr>
<div>
{% include "analytics/realm_details.html" %}