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): ...@@ -1927,7 +1927,6 @@ class BaseModelView(BaseView, ActionsMixin):
model=model, model=model,
details_columns=self._details_columns, details_columns=self._details_columns,
get_value=self.get_list_value, get_value=self.get_list_value,
get_pk_value=self.get_pk_value,
return_url=return_url) return_url=return_url)
@expose('/delete/', methods=('POST',)) @expose('/delete/', methods=('POST',))
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
{%- endif -%} {%- endif -%}
{%- if admin_view.can_edit -%} {%- if admin_view.can_edit -%}
<li> <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> </li>
{%- endif -%} {%- endif -%}
<li class="active"> <li class="active">
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</li> </li>
{%- if admin_view.can_view_details -%} {%- if admin_view.can_view_details -%}
<li> <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> </li>
{%- endif -%} {%- endif -%}
</ul> </ul>
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
{%- endif -%} {%- endif -%}
{%- if admin_view.can_edit -%} {%- if admin_view.can_edit -%}
<li> <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> </li>
{%- endif -%} {%- endif -%}
<li class="active"> <li class="active">
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</li> </li>
{%- if admin_view.can_view_details -%} {%- if admin_view.can_view_details -%}
<li> <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> </li>
{%- endif -%} {%- endif -%}
</ul> </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