Code

Opened 7 years ago

Closed 7 years ago

#5532 closed (duplicate)

Adding user via admin site doesn't work if TEMPLATE_STRING_IF_INVALID is defined

Reported by: Raphaël Hertzog <raphael@…> Owned by: nobody
Component: contrib.admin Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I use TEMPLATE_STRING_IF_INVALID during development to catch quickly errors in my templates. However this breaks the "Add user" functionality of the admin interface. That's because "form_url" is not defined in the template parameters of user_add_stage in
django/contrib/admin/views/auth.py ... and thus the template creates a form with a bad action parameter (instead of letting the parmater empty).

There might be other similar instances elsewhere in the code, I haven't checked.

--- tmp/auth.py 2007-09-18 16:04:46.000000000 +0200
+++ django/contrib/admin/views/auth.py  2007-09-18 16:00:32.000000000 +0200
@@ -30,6 +30,7 @@
     return render_to_response('admin/auth/user/add_form.html', {
         'title': _('Add user'),
         'form': form,
+        'form_url': '',
         'is_popup': '_popup' in request.REQUEST,
         'add': True,
         'change': False,

Attachments (0)

Change History (2)

comment:1 Changed 7 years ago by ramiro

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Other previous similar reports have been closed as duplicates of #3579. Considering the admin app in it's current form is being deprecated and no effort is being put in doing large scale bugfixes, I suspect this reliance in empty a TEMPLATE_STRING_IF_INVALID value won't be fixed.

I don't know if this also applies to newforms-admin though.

comment:2 Changed 7 years ago by ubernostrum

  • Resolution set to duplicate
  • Status changed from new to closed

Going to close this as a dupe of #3579.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.