Skip to content

Commit baf5e68

Browse files
committed
fix to make travis works
1 parent f8c72db commit baf5e68

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

src/oscar_accounts/abstract_models.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
from treebeard.mp_tree import MP_Node
1212

1313
from oscar_accounts import exceptions
14-
from oscar_accounts.compact_oscar import AUTH_USER_MODEL
14+
15+
# from oscar.core.compat
16+
# A setting that can be used in foreign key declarations
17+
AUTH_USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')
1518

1619

1720
class ActiveAccountManager(models.Manager):

src/oscar_accounts/compact_oscar.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,9 @@
55
from importlib import import_module
66
from django.apps import apps
77
from django.apps.config import MODELS_MODULE_NAME
8-
from django.conf import settings
9-
from django.core.exceptions import ImproperlyConfigured, AppRegistryNotReady
8+
from django.core.exceptions import AppRegistryNotReady
109
from django import forms
1110

12-
# from oscar.core.compat
13-
# A setting that can be used in foreign key declarations
14-
AUTH_USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')
15-
try:
16-
AUTH_USER_APP_LABEL, AUTH_USER_MODEL_NAME = AUTH_USER_MODEL.rsplit('.', 1)
17-
except ValueError:
18-
raise ImproperlyConfigured("AUTH_USER_MODEL must be of the form"
19-
" 'app_label.model_name'")
20-
2111
# from oscar.core.loading
2212
def get_model(app_label, model_name):
2313
"""
@@ -88,7 +78,6 @@ def post_process_urls(self, urlpatterns):
8878
else: # oscar is installed, use it.
8979
from oscar.apps.payment.exceptions import UnableToTakePayment
9080
from oscar.core.application import Application
91-
from oscar.core.compat import AUTH_USER_MODEL
9281
from oscar.core.loading import get_model, is_model_registered
9382
from oscar.forms.widgets import DatePickerInput
9483
from oscar.templatetags.currency_filters import currency

0 commit comments

Comments
 (0)