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:
@@ -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__,
|
||||
|
Reference in New Issue
Block a user