Permalink
Browse files

Fixed a bunch of issues and improved the info on the error reporting …

…system.
  • Loading branch information...
1 parent 5468506 commit ae351bbb21daf54a8a5539a1c84c36642cb2a419 @arthur-debert arthur-debert committed Apr 20, 2012
Showing with 32 additions and 5 deletions.
  1. +10 −3 templates/internal/error-report.txt
  2. +20 −1 utils/errorreport.py
  3. +2 −1 utils/tasks.py
@@ -1,9 +1,16 @@
-Total Unresolved Errors: {{data.errors_count}}
+Total Unresolved Errors: {{errors_count}}
New errors today: {{new_errors_count}}
+Errors today: {{today_errors_count}}
-Today's errors: {% for e in new_errors %}
+New errors today: {% for e in new_errors %}
{{e.message|safe}}
- - today: {{e.today.count}}, last week: {{e.last_week_count}}, all time: {{e.total_count}}
+ - today: {{e.today_count}}, last week: {{e.last_week_count}}, all time: {{e.total_count}}
+ - https://{{base_url}}{% url sentry-group e.pk %}
+{%endfor %}
+
+Errors today: {% for e in today_errors %}
+{{e.message|safe}}
+ - today: {{e.today_count}}, last week: {{e.last_week_count}}, all time: {{e.total_count}}
- https://{{base_url}}{% url sentry-group e.pk %}
{%endfor %}
View
@@ -57,5 +57,24 @@ def _error_report_data(date=None):
data['new_errors'] = new_errors_data
data['errors_count'] = errors.count()
data['new_errors_count'] = new_errors.count()
- data['base_url'] = Site.objects.get_current().domain
+ today_errors = _errors_seen_on(date, last_seen=True).exclude(id__in=[x.id for x in new_errors])
+ today_errors_data = []
+ for error in today_errors:
+ today_errors_data.append ( {
+ 'message': error.message,
+ 'pk': error.pk,
+ "total_count": error.message_set.count(),
+ "today_count": error.message_set.filter(
+ datetime__day=date.day,
+ datetime__month=date.month,
+ datetime__year=date.year,
+ ).count(),
+ "last_week_count":error.message_set.filter(
+ datetime__gte=last_week,
+ datetime__lte=date,
+
+ ).count()
+ })
+ data['today_errors'] = today_errors_data
+ data['today_errors_count'] = today_errors.count()
return data
View
@@ -47,5 +47,6 @@ def send_error_report(date=None):
return
data = errorreport._error_report_data(date)
message = render_to_string("internal/error-report.txt", data)
- subject = date.strftime("Errors for Amara for %Y/%M/%d")
+ subject_prefix = "Errors for Amara (%s) on " % settings.SITE_NAME
+ subject = date.strftime(subject_prefix + "%Y/%m/%d" )
send_mail(subject, message, "unisubs error bot", recipients)

1 comment on commit ae351bb

Contributor

sjl commented on ae351bb Apr 25, 2012

👍

Please sign in to comment.