Ticket #4225: contrib.auth.views.login_fixed2.patch

File contrib.auth.views.login_fixed2.patch, 799 bytes (added by mconte, 18 years ago)

Sorry :( This is the patch. Forget the others.

  • views.py

     
    2525            return HttpResponseRedirect(redirect_to)
    2626    else:
    2727        errors = {}
     28    if Site._meta.installed:
     29        site_name = Site.objects.get_current().name
     30    else:
     31        site_name = 'my site'
    2832    request.session.set_test_cookie()
    2933    return render_to_response(template_name, {
    3034        'form': oldforms.FormWrapper(manipulator, request.POST, errors),
    3135        REDIRECT_FIELD_NAME: redirect_to,
    32         'site_name': Site.objects.get_current().name,
     36        'site_name': site_name
    3337    }, context_instance=RequestContext(request))
    3438
    3539def logout(request, next_page=None, template_name='registration/logged_out.html'):
Back to Top