[extensions-web] Add "approve"/"reject" actions to ext. ver admin for easy testing
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [extensions-web] Add "approve"/"reject" actions to ext. ver admin for easy testing
- Date: Fri, 23 Sep 2011 23:09:41 +0000 (UTC)
commit 5b85cb24466e66410284a2450b732a17b03e55d4
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Fri Sep 23 17:16:23 2011 -0400
Add "approve"/"reject" actions to ext. ver admin for easy testing
sweettooth/extensions/admin.py | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/sweettooth/extensions/admin.py b/sweettooth/extensions/admin.py
index 50337b1..4e9a665 100644
--- a/sweettooth/extensions/admin.py
+++ b/sweettooth/extensions/admin.py
@@ -3,6 +3,7 @@ from django.contrib import admin
from sorl.thumbnail.admin import AdminImageMixin
from extensions.models import Extension, ExtensionVersion
+from extensions.models import STATUS_ACTIVE, STATUS_REJECTED
from review.models import CodeReview
class CodeReviewAdmin(admin.TabularInline):
@@ -12,6 +13,7 @@ class CodeReviewAdmin(admin.TabularInline):
class ExtensionVersionAdmin(admin.ModelAdmin):
list_display = 'title', 'status',
list_display_links = 'title',
+ actions = 'approve', 'reject',
def title(self, ver):
return "%s (%d)" % (ver.extension.uuid, ver.version)
@@ -19,6 +21,12 @@ class ExtensionVersionAdmin(admin.ModelAdmin):
inlines = [CodeReviewAdmin]
+ def approve(self, request, queryset):
+ queryset.update(status=STATUS_ACTIVE)
+
+ def reject(self, request, queryset):
+ queryset.update(status=STATUS_REJECTED)
+
admin.site.register(ExtensionVersion, ExtensionVersionAdmin)
class ExtensionVersionInline(admin.TabularInline):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]