From 21fc169b29029e5da0c70eb5a727f5955db15bb5 Mon Sep 17 00:00:00 2001 From: Chris Church Date: Fri, 26 Jul 2013 22:00:44 -0400 Subject: [PATCH] Fix for imports in awx.main.utils. --- awx/main/utils.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/awx/main/utils.py b/awx/main/utils.py index 0bdf7fe1ad..e8d900769e 100644 --- a/awx/main/utils.py +++ b/awx/main/utils.py @@ -3,10 +3,6 @@ import logging import re import sys -# Django -from django.conf import settings -from django.shortcuts import _get_queryset - # Django REST Framework from rest_framework.exceptions import ParseError, PermissionDenied @@ -17,6 +13,7 @@ def get_object_or_400(klass, *args, **kwargs): Return a single object from the given model or queryset based on the query params, otherwise raise an exception that will return in a 400 response. ''' + from django.shortcuts import _get_queryset queryset = _get_queryset(klass) try: return queryset.get(*args, **kwargs) @@ -30,6 +27,7 @@ def get_object_or_403(klass, *args, **kwargs): Return a single object from the given model or queryset based on the query params, otherwise raise an exception that will return in a 403 response. ''' + from django.shortcuts import _get_queryset queryset = _get_queryset(klass) try: return queryset.get(*args, **kwargs) @@ -51,4 +49,5 @@ class RequireDebugTrueOrTest(logging.Filter): ''' def filter(self, record): + from django.conf import settings return settings.DEBUG or 'test' in sys.argv