Skip to content

Commit

Permalink
Fix BatchAction class incongruence between documentation and code
Browse files Browse the repository at this point in the history
Fixes launchpad bug #1044424

The BatchAction class in the tables package define the success_url variable in the docs but use completion_url in the code.

Change-Id: Ia93eeee4eccb4250d4b0984f38585175de738907
  • Loading branch information
rodis committed Aug 31, 2012
1 parent 856083a commit caf8eaf
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
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
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 caf8eaf

Please sign in to comment.