Example #1
0
    distributed under the License is distrubuted on an "AS IS" BASICS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
"""
__AUTHOR__ = "lambdalisue ([email protected])"
import sys

from django.conf import settings
from django.contrib.auth import login
from django.contrib.auth import get_backends

from registration import setconf
from registration.signals import user_activated

setconf('REGISTRATION_AUTO_LOGIN', True)


def is_auto_login_enable():
    """get whether the registration autologin is enable"""
    if not settings.REGISTRATION_AUTO_LOGIN:
        return False
    if 'test' in sys.argv and not getattr(
            settings, '_REGISTRATION_AUTO_LOGIN_IN_TESTS', False):
        # Registration Auto Login is not available in test to prevent the test
        # fails of ``registration.tests.*``.
        # For testing Registration Auto Login, you must set
        # ``_REGISTRATION_AUTO_LOGIN_IN_TESTS`` to ``True``
        return False
    return True
    distributed under the License is distrubuted on an "AS IS" BASICS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
"""
__AUTHOR__ = "lambdalisue ([email protected])"
import sys

from django.conf import settings
from django.contrib.auth import login
from django.contrib.auth import get_backends

from registration import setconf
from registration.signals import user_activated

setconf('REGISTRATION_AUTO_LOGIN', True)


def is_auto_login_enable():
    """get whether the registration autologin is enable"""
    if not settings.REGISTRATION_AUTO_LOGIN:
        return False
    if 'test' in sys.argv and not getattr(settings, '_REGISTRATION_AUTO_LOGIN_IN_TESTS', False):
        # Registration Auto Login is not available in test to prevent the test
        # fails of ``registration.tests.*``.
        # For testing Registration Auto Login, you must set
        # ``_REGISTRATION_AUTO_LOGIN_IN_TESTS`` to ``True``
        return False
    return True

    limitations under the License.
"""
__AUTHOR__ = "lambdalisue ([email protected])"
import sys
import warnings

from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.template.loader import render_to_string

from registration import setconf
from registration.utils import get_site
from registration.utils import send_mail
from registration.signals import user_registered

setconf('REGISTRATION_NOTIFICATION', True)
setconf('REGISTRATION_NOTIFICATION_ADMINS', True)
setconf('REGISTRATION_NOTIFICATION_MANAGERS', True)
setconf('REGISTRATION_NOTIFICATION_RECIPIENTS', None)

setconf('REGISTRATION_NOTIFICATION_EMAIL_TEMPLATE_NAME',
        r'registration/notification_email.txt')
setconf('REGISTRATION_NOTIFICATION_EMAIL_SUBJECT_TEMPLATE_NAME',
        r'registration/notification_email_subject.txt')


def is_notification_enable():
    """get whether the registration notification is enable"""
    if not settings.REGISTRATION_NOTIFICATION:
        return False
    if 'test' in sys.argv and not getattr(settings, '_REGISTRATION_NOTIFICATION_IN_TESTS', False):
Example #4
0
    limitations under the License.
"""
__AUTHOR__ = "lambdalisue ([email protected])"
import sys
import warnings

from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.template.loader import render_to_string

from registration import setconf
from registration.utils import get_site
from registration.utils import send_mail
from registration.signals import user_registered

setconf('REGISTRATION_NOTIFICATION', True)
setconf('REGISTRATION_NOTIFICATION_ADMINS', True)
setconf('REGISTRATION_NOTIFICATION_MANAGERS', True)
setconf('REGISTRATION_NOTIFICATION_RECIPIENTS', None)

setconf('REGISTRATION_NOTIFICATION_EMAIL_TEMPLATE_NAME',
        r'registration/notification_email.txt')
setconf('REGISTRATION_NOTIFICATION_EMAIL_SUBJECT_TEMPLATE_NAME',
        r'registration/notification_email_subject.txt')


def is_notification_enable():
    """get whether the registration notification is enable"""
    if not settings.REGISTRATION_NOTIFICATION:
        return False
    if 'test' in sys.argv and not getattr(