[extensions-web: 72/75] Add error reports to admin.
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [extensions-web: 72/75] Add error reports to admin.
- Date: Fri, 23 Sep 2011 03:20:29 +0000 (UTC)
commit bfdf2b45baf6a57bf186ef6e710e081d1abb104f
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Thu Sep 22 22:47:26 2011 -0400
Add error reports to admin.
sweettooth/extensions/admin.py | 20 +++++++++++++++++++-
1 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/sweettooth/extensions/admin.py b/sweettooth/extensions/admin.py
index 50337b1..2054130 100644
--- a/sweettooth/extensions/admin.py
+++ b/sweettooth/extensions/admin.py
@@ -2,7 +2,7 @@
from django.contrib import admin
from sorl.thumbnail.admin import AdminImageMixin
-from extensions.models import Extension, ExtensionVersion
+from extensions.models import Extension, ExtensionVersion, ErrorReport
from review.models import CodeReview
class CodeReviewAdmin(admin.TabularInline):
@@ -37,3 +37,21 @@ class ExtensionAdmin(admin.ModelAdmin):
inlines = [ExtensionVersionInline]
admin.site.register(Extension, ExtensionAdmin)
+
+class ErrorReportAdmin(admin.ModelAdmin):
+ list_display = 'user_or_email', 'extension', 'version_num'
+ list_display_links = list_display
+
+ def user_or_email(self, report):
+ if report.user:
+ return report.user
+ else:
+ return report.email
+
+ def version_num(self, report):
+ return report.version.version
+
+ def extension(self, report):
+ return report.version.extension
+
+admin.site.register(ErrorReport, ErrorReportAdmin)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]