#9881: Auth login should pass current_site to template, not current_site.name
----------------------------+-----------------------------------------------
 Reporter:  walterk         |       Owner:  nobody    
   Status:  new             |   Milestone:            
Component:  Authentication  |     Version:  SVN       
 Keywords:                  |       Stage:  Unreviewed
Has_patch:  0               |  
----------------------------+-----------------------------------------------
 Currently, django.contrib.auth's login method passes 'current_site.name'
 to the template:

 {{{
     return render_to_response(template_name, {
         'form': form,
         redirect_field_name: redirect_to,
         'site_name': current_site.name,
     }, context_instance=RequestContext(request))
 login = never_cache(login)
 }}}

 It would be preferable if the dictionary pair were ''''site':
 current_site''' instead.  (This is how django-registration works.)  In my
 current project, 'site_name' overrides a variable defined in a custom
 context processor, which serves the same function.  We prefer to not use
 contrib.sites to pass the site name and domain to templates, since this
 requires slightly more set up and maintenance. (E.g., making sure
 'example.com' gets replaced whenever the database gets wiped.)

 Passing ''''site': current_site''' instead of ''''site_name':
 current_site.name''' would make contrib.auth behavior more consistent with
 the django-registration module as well.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/9881>
Django <http://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 this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to