Skip to content

Commit

Permalink
Merge "Fix BatchAction class incongruence between documentation and c…
Browse files Browse the repository at this point in the history
…ode Fixes launchpad bug #1044424"
  • Loading branch information
Jenkins authored and openstack-gerrit committed Sep 1, 2012
2 parents 665c26f + caf8eaf commit 6e949ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions horizon/dashboards/nova/containers/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def wrap_delimiter(name):
class DeleteContainer(tables.DeleteAction):
data_type_singular = _("Container")
data_type_plural = _("Containers")
completion_url = "horizon:nova:containers:index"
success_url = "horizon:nova:containers:index"

def delete(self, request, obj_id):
api.swift_delete_container(request, obj_id)
Expand All @@ -52,7 +52,7 @@ def get_success_url(self, request=None):
# If the current_container is deleted, then redirect to the default
# completion url
if current_container in self.success_ids:
return self.completion_url
return self.success_url
return request.get_full_path()


Expand Down
6 changes: 3 additions & 3 deletions horizon/tables/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ class BatchAction(Action):
Optional location to redirect after completion of the delete
action. Defaults to the current page.
"""
completion_url = None
success_url = None

def __init__(self):
self.current_present_action = 0
Expand Down Expand Up @@ -489,8 +489,8 @@ def get_success_url(self, request=None):
"""
Returns the URL to redirect to after a successful action.
"""
if self.completion_url:
return self.completion_url
if self.success_url:
return self.success_url
return request.get_full_path()

def handle(self, table, request, obj_ids):
Expand Down

0 comments on commit 6e949ac

Please sign in to comment.