Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Bugfix/issue95 #96

Merged
merged 3 commits into from
Oct 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion ringo/lib/helpers/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,16 @@ def get_action_url(request, item, action):
"""
route_name = get_action_routename(item, action)
if isinstance(item, object):
return request.route_path(route_name, id=item.id)
# If backurl is set
if hasattr(request.context, "__model__"):
clazz = request.context.__model__
backurl = request.session.get('%s.backurl' % clazz)
else:
backurl = None
query = {}
if backurl:
query['backurl'] = backurl
return request.route_path(route_name, id=item.id, _query=query)
# TODO: Is this code ever reached. See testcase (ti) <2014-02-25 23:17>
return request.route_path(route_name)

Expand Down
5 changes: 3 additions & 2 deletions ringo/lib/renderer/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ def get_link_url(item, request, actionname=None, backurl=False):
return None

query = {}
if not readmode and backurl:
query['backurl'] = request.current_route_path()
if backurl:
clazz = request.context.__model__
query['backurl'] = request.session.get('%s.backurl' % clazz) or request.current_route_path()
return request.route_path(route_name, id=item.id, _query=query)
return None

Expand Down