bug fix for commit

This commit is contained in:
Alex Seeholzer 2015-02-11 13:23:42 +01:00
parent 9665361bb1
commit ddabc9d133

View File

@ -11,6 +11,7 @@ from django.db import models
from django.contrib.auth import get_user_model from django.contrib.auth import get_user_model
from django.conf import settings from django.conf import settings
from django.utils.translation import ugettext_lazy as _, ugettext from django.utils.translation import ugettext_lazy as _, ugettext
from django import VERSION
try: try:
from django.utils import timezone from django.utils import timezone
@ -1043,7 +1044,7 @@ def create_usersettings(sender, instance, created, **kwargs):
try: try:
# Connecting via settings.AUTH_USER_MODEL (string) fails in Django < 1.7. We need the actual model there. # Connecting via settings.AUTH_USER_MODEL (string) fails in Django < 1.7. We need the actual model there.
# https://docs.djangoproject.com/en/1.7/topics/auth/customizing/#referencing-the-user-model # https://docs.djangoproject.com/en/1.7/topics/auth/customizing/#referencing-the-user-model
if django.VERSION < (1, 7): if VERSION < (1, 7):
raise ValueError raise ValueError
models.signals.post_save.connect(create_usersettings, sender=settings.AUTH_USER_MODEL) models.signals.post_save.connect(create_usersettings, sender=settings.AUTH_USER_MODEL)
except: except: