Merge lp:~pwlars/lava-dashboard/admin-delete-entire-bundle into lp:lava-dashboard

Proposed by Paul Larson
Status: Merged
Approved by: Zygmunt Krynicki
Approved revision: 306
Merged at revision: 306
Proposed branch: lp:~pwlars/lava-dashboard/admin-delete-entire-bundle
Merge into: lp:lava-dashboard
Diff against target: 38 lines (+10/-0)
2 files modified
dashboard_app/admin.py (+7/-0)
doc/changes.rst (+3/-0)
To merge this branch: bzr merge lp:~pwlars/lava-dashboard/admin-delete-entire-bundle
Reviewer Review Type Date Requested Status
Zygmunt Krynicki (community) Approve
Review via email: mp+97926@code.launchpad.net

Description of the change

Alexandros was asking today how he might delete a bundle, he has some test data in a cloud instance he's working on and it's using a lot of space. He wants to remove some of the old ones. The existing delete admin function is insufficient to remove all the related data, but I think this should do it.

To post a comment you must log in.
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

+1 :-)

review: Approve
307. By Paul Larson

add changelog entry

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'dashboard_app/admin.py'
2--- dashboard_app/admin.py 2011-12-20 04:09:12 +0000
3+++ dashboard_app/admin.py 2012-03-17 11:18:18 +0000
4@@ -42,6 +42,12 @@
5 TestingEffort,
6 )
7
8+def delete_bundle_action(modeladmin, request, queryset):
9+ for bundle in queryset:
10+ bundle.delete_files()
11+ bundle.delete()
12+delete_bundle_action.short_description = "Delete bundle and related data"
13+
14
15 class BundleAdmin(admin.ModelAdmin):
16
17@@ -49,6 +55,7 @@
18 return bundle.bundle_stream.pathname
19 bundle_stream_pathname.short_description = _("Bundle stream")
20
21+ actions = [delete_bundle_action]
22 list_display = ('bundle_stream_pathname', 'content_filename',
23 'uploaded_by', 'uploaded_on', 'is_deserialized')
24 list_filter = ('bundle_stream',)
25
26=== modified file 'doc/changes.rst'
27--- doc/changes.rst 2012-03-15 20:40:42 +0000
28+++ doc/changes.rst 2012-03-17 11:18:18 +0000
29@@ -6,6 +6,9 @@
30 Version 0.14
31 ============
32
33+* Add an admin function to support deleting an entire bundle, including
34+ referenced test runs and results
35+
36 .. _version_0_13:
37
38 Version 0.13

Subscribers

People subscribed via source and target branches