1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-23 04:18:21 +00:00

[Django 1.11] Feature removed in Django 1.9. Use shortcut to get current site

This commit is contained in:
zhengxie
2018-02-06 17:36:04 +08:00
parent 2d56fd73c0
commit 663eebc8ed
10 changed files with 28 additions and 41 deletions

View File

@@ -1,6 +1,5 @@
from django.conf import settings
from django.contrib.sites.models import RequestSite
from django.contrib.sites.models import Site
from django.contrib.sites.shortcuts import get_current_site
from registration import signals
from registration.forms import RegistrationForm
@@ -71,10 +70,8 @@ class DefaultBackend(object):
"""
username, email, password = kwargs['username'], kwargs['email'], kwargs['password1']
if Site._meta.installed:
site = Site.objects.get_current()
else:
site = RequestSite(request)
site = get_current_site(request)
new_user = RegistrationProfile.objects.create_inactive_user(username, email,
password, site)
signals.user_registered.send(sender=self.__class__,