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

changed notification title and subtitle; removed body #2027

Merged
merged 13 commits into from
May 26, 2023
Prev Previous commit
Next Next commit
fix title
  • Loading branch information
imtoori committed May 26, 2023

Verified

This commit was signed with the committer’s verified signature.
rezkiy37 Michael (Mykhailo) Kravchenko
commit 6f4b9b747e68cc7eda1d56dfa03d6cd53afbb0ce
3 changes: 2 additions & 1 deletion engine/apps/mobile_app/alert_rendering.py
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@ def get_push_notification_subtitle(alert_group):
elif alert_group.acknowledged:
status_verbose = alert_group.get_acknowledge_text()

number_of_alerts = alert_group.alerts.count()
if number_of_alerts <= 10:
alerts_count_str = str(number_of_alerts)
else:
@@ -30,7 +31,7 @@ def get_push_notification_subtitle(alert_group):


subtitle = f"#{alert_group.inside_organization_number} {alert_title}\n"
+ emojize(f"{title} via {alert_group.channel.short_name}", use_aliases=True)
+ emojize(f"via {alert_group.channel.short_name}", use_aliases=True)
+ f"\n{alert_status}"

return subtitle
1 change: 0 additions & 1 deletion engine/apps/mobile_app/tasks.py
Original file line number Diff line number Diff line change
@@ -153,7 +153,6 @@ def _get_alert_group_escalation_fcm_message(
from apps.mobile_app.models import MobileAppUserSettings

thread_id = f"{alert_group.channel.organization.public_primary_key}:{alert_group.public_primary_key}"
number_of_alerts = alert_group.alerts.count()

alert_title = "New Alert" if critical else "New Important Alert"
alert_subtitle = get_push_notification_subtitle(alert_group)