Ticket #7274: reset_password_site_not_required_r7540.diff

File reset_password_site_not_required_r7540.diff, 914 bytes (added by joshrl <jrookeley@…>, 16 years ago)
  • django/contrib/auth/views.py

     
    7474            if is_admin_site:
    7575                form.save(domain_override=request.META['HTTP_HOST'])
    7676            else:
    77                 form.save(email_template_name=email_template_name)
     77                if Site._meta.installed:
     78                    form.save(email_template_name=email_template_name)
     79                else:
     80                    site = RequestSite(request)
     81                    form.save(domain_override=site.domain,email_template_name=email_template_name)
    7882            return HttpResponseRedirect('%sdone/' % request.path)
    7983    return render_to_response(template_name, {'form': oldforms.FormWrapper(form, new_data, errors)},
    8084        context_instance=RequestContext(request))
Back to Top