mirror of
https://github.com/status-im/cabot.git
synced 2025-02-24 10:28:06 +00:00
Merge pull request #1 from Labgoo/feature/Add_last_result_content_to_email_alert
add last result content to the email body
This commit is contained in:
commit
1029ebf5c5
@ -15,7 +15,7 @@ logger = logging.getLogger(__name__)
|
|||||||
email_template = """Service {{ service.name }} {{ scheme }}://{{ host }}{% url 'service' pk=service.id %} {% if service.overall_status != service.PASSING_STATUS %}alerting with status: {{ service.overall_status }}{% else %}is back to normal{% endif %}.
|
email_template = """Service {{ service.name }} {{ scheme }}://{{ host }}{% url 'service' pk=service.id %} {% if service.overall_status != service.PASSING_STATUS %}alerting with status: {{ service.overall_status }}{% else %}is back to normal{% endif %}.
|
||||||
{% if service.overall_status != service.PASSING_STATUS %}
|
{% if service.overall_status != service.PASSING_STATUS %}
|
||||||
CHECKS FAILING:{% for check in service.all_failing_checks %}
|
CHECKS FAILING:{% for check in service.all_failing_checks %}
|
||||||
FAILING - {{ check.name }} - Type: {{ check.check_category }} - Importance: {{ check.get_importance_display }}{% endfor %}
|
FAILING - {{ check.name }} - Type: {{ check.check_category }} - Importance: {{ check.get_importance_display }} - Last Result: {{ check.last_result.raw_data }}{% endfor %}
|
||||||
{% if service.all_passing_checks %}
|
{% if service.all_passing_checks %}
|
||||||
Passing checks:{% for check in service.all_passing_checks %}
|
Passing checks:{% for check in service.all_passing_checks %}
|
||||||
PASSING - {{ check.name }} - Type: {{ check.check_category }} - Importance: {{ check.get_importance_display }}{% endfor %}
|
PASSING - {{ check.name }} - Type: {{ check.check_category }} - Importance: {{ check.get_importance_display }}{% endfor %}
|
||||||
|
@ -437,6 +437,7 @@ class StatusCheck(PolymorphicModel):
|
|||||||
# on time_complete
|
# on time_complete
|
||||||
return StatusCheckResult.objects.filter(check=self).order_by('-id').defer('raw_data')[:10]
|
return StatusCheckResult.objects.filter(check=self).order_by('-id').defer('raw_data')[:10]
|
||||||
|
|
||||||
|
@property
|
||||||
def last_result(self):
|
def last_result(self):
|
||||||
try:
|
try:
|
||||||
return StatusCheckResult.objects.filter(check=self).order_by('-id').defer('raw_data')[0]
|
return StatusCheckResult.objects.filter(check=self).order_by('-id').defer('raw_data')[0]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user