Changeset 8385 broke UserAdmin's add_view
|Patch needs improvement:
 converted some template logic into python code directly not taking into account that the logic is assuming that certain context variables exist. This obviously wasn't a problem in the template, but is causing a number of KeyErrors in the new templatetag if the context vars it is looking for (adminform, inline_admin_formsets) don't exist. In particular it is throwing these errors when you try to add a new contrib.auth user since UserAdmin overrides the add_view method and doesn't set those context vars.