#13696: Admin Edit Inline templates don' t output hidden field for PK when it 
isn't
an autoField and has editable=False
----------------------------------+------------------------------------
     Reporter:  evan.reiser@…     |                    Owner:  dArignac
         Type:  Bug               |                   Status:  reopened
    Component:  contrib.admin     |                  Version:  1.2
     Severity:  Normal            |               Resolution:
     Keywords:  inline templates  |             Triage Stage:  Accepted
    Has patch:  1                 |      Needs documentation:  0
  Needs tests:  0                 |  Patch needs improvement:  0
Easy pickings:  1                 |                    UI/UX:  0
----------------------------------+------------------------------------

Comment (by brianglass):

 I am affected by a very similar problem (though technically unrelated) in
 the same template. When I have a model that has a field that is not named
 id, the "View on site" link in the inline editing section is missing the
 pk in the url. So the link ends up going to nowhere. The relevant code is:

 {{{
 {% if inline_admin_form.show_url %}<a href="../../../r/{{
 inline_admin_form.original_content_type_id }}/{{
 inline_admin_form.original.id }}/">{% trans "View on site" %}</a>{% endif
 %}
 }}}

 Instead of {{ inline_admin_form.original.id }}, I think it should be {{
 inline_admin_form.original.pk }}.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/13696#comment:18>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to