Skip to content

Commit

Permalink
Use get_model() from django.apps instead of get_model() from compat.
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanmkoncz committed Dec 13, 2017
1 parent b744459 commit 4e23d45
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions openinghours/utils.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import datetime
from django.conf import settings
try:
from threadlocals.threadlocals import get_current_request
except ImportError:
get_current_request = None
from openinghours.models import OpeningHours, ClosingRules, PREMISES_MODEL
from django.core.exceptions import ImproperlyConfigured

from compat import get_model
from django.apps import apps


def get_premises_model():
Expand All @@ -20,7 +18,7 @@ def get_premises_model():
except ValueError:
raise ImproperlyConfigured("OPENINGHOURS_PREMISES_MODEL must be of the"
" form 'app_label.model_name'")
premises_model = get_model(app_label=app_label, model_name=model_name)
premises_model = apps.get_model(app_label=app_label, model_name=model_name)
if premises_model is None:
raise ImproperlyConfigured("OPENINGHOURS_PREMISES_MODEL refers to"
" model '%s' that has not been installed"
Expand Down

0 comments on commit 4e23d45

Please sign in to comment.