Commit dc78889c authored by Paul Brown's avatar Paul Brown

prevent assuming 'id' is primary key for details view

parent 3b5d929a
......@@ -1927,7 +1927,6 @@ class BaseModelView(BaseView, ActionsMixin):
model=model,
details_columns=self._details_columns,
get_value=self.get_list_value,
get_pk_value=self.get_pk_value,
return_url=return_url)
@expose('/delete/', methods=('POST',))
......
......@@ -14,7 +14,7 @@
{%- endif -%}
{%- if admin_view.can_edit -%}
<li>
<a href="{{ get_url('.edit_view', id=get_pk_value(model), url=return_url) }}">{{ _gettext('Edit') }}</a>
<a href="{{ get_url('.edit_view', id=request.args.get('id'), url=return_url) }}">{{ _gettext('Edit') }}</a>
</li>
{%- endif -%}
<li class="active">
......
......@@ -27,7 +27,7 @@
</li>
{%- if admin_view.can_view_details -%}
<li>
<a href="{{ get_url('.details_view', id=model.id, url=return_url) }}">{{ _gettext('Details') }}</a>
<a href="{{ get_url('.details_view', id=request.args.get('id'), url=return_url) }}">{{ _gettext('Details') }}</a>
</li>
{%- endif -%}
</ul>
......
......@@ -14,7 +14,7 @@
{%- endif -%}
{%- if admin_view.can_edit -%}
<li>
<a href="{{ get_url('.edit_view', id=get_pk_value(model), url=return_url) }}">{{ _gettext('Edit') }}</a>
<a href="{{ get_url('.edit_view', id=request.args.get('id'), url=return_url) }}">{{ _gettext('Edit') }}</a>
</li>
{%- endif -%}
<li class="active">
......
......@@ -27,7 +27,7 @@
</li>
{%- if admin_view.can_view_details -%}
<li>
<a href="{{ get_url('.details_view', id=model.id, url=return_url) }}">{{ _gettext('Details') }}</a>
<a href="{{ get_url('.details_view', id=request.args.get('id'), url=return_url) }}">{{ _gettext('Details') }}</a>
</li>
{%- endif -%}
</ul>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment