Skip to content

Commit

Permalink
Fix case of rendering inline models without permission
Browse files Browse the repository at this point in the history
  • Loading branch information
Fantomas42 committed Jun 14, 2013
1 parent 6aa81bf commit db3b620
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions admin_tabs/templatetags/admin_tabs_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@ def render_fieldsets_for_admincol(context, admin_col):
context["fieldset"] = f
out += render_to_string(template, context)
elif "inline" in options:
inline_admin_formset = inline_matching[options["inline"]]
context["inline_admin_formset"] = inline_admin_formset
out += render_to_string(inline_admin_formset.opts.template, context)
try:
inline_admin_formset = inline_matching[options["inline"]]
context["inline_admin_formset"] = inline_admin_formset
out += render_to_string(inline_admin_formset.opts.template, context)
except KeyError: # The user does not have the permission
pass
return out

0 comments on commit db3b620

Please sign in to comment.