Skip to content
Snippets Groups Projects
Commit 054c5727 authored by Alice Heaton's avatar Alice Heaton :speech_balloon:
Browse files

Add a default location when we have an action without a location.

parent 952e07b4
Branches
No related tags found
No related merge requests found
...@@ -168,11 +168,15 @@ class ViewItems(SingleTableView): ...@@ -168,11 +168,15 @@ class ViewItems(SingleTableView):
it is defaulted to 'none' and placement to 'top'. it is defaulted to 'none' and placement to 'top'.
""" """
new_params = QueryDict('', mutable=True) new_params = QueryDict('', mutable=True)
placement = re.sub('^[^-]+-', '', params.get('action', 'none-top')) action = params.get('action', 'none-top')
if '-' in action:
placement = re.sub('^[^-]+-', '', action)
action = action[0:len(action) - len(placement) - 1]
else:
placement = 'top'
for name, value in params.iterlists(): for name, value in params.iterlists():
if name == 'action': if name == 'action':
action_name = value[0] value = [action]
value = [action_name[0:len(action_name)-len(placement)-1]]
elif name.endswith(placement): elif name.endswith(placement):
name = name[0:len(name)-len(placement)-1] name = name[0:len(name)-len(placement)-1]
new_params.setlist(name, value) new_params.setlist(name, value)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment