Skip to content

Commit

Permalink
fix contenttype warnings. See #15
Browse files Browse the repository at this point in the history
  • Loading branch information
andybak committed Aug 22, 2015
1 parent fada3f2 commit 9470008
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 5 additions & 2 deletions admin_tools/dashboard/dashboards.py
Expand Up @@ -10,7 +10,6 @@
from django.utils.importlib import import_module
from django.utils.translation import ugettext_lazy as _
from django.core.urlresolvers import reverse
from django.contrib.contenttypes.models import ContentType
from django.utils.encoding import force_text

from admin_tools.dashboard import modules
Expand Down Expand Up @@ -201,7 +200,11 @@ def get_app_content_types(self):
"""
Return a list of all content_types for this app.
"""
return [ContentType.objects.get_for_model(c) for c \

# Import this here to silence RemovedInDjango19Warning. See #15
from django.contrib.contenttypes.models import ContentType

return [ContentType.objects.get_for_model(c) for c
in self.get_app_model_classes()]

def get_id(self):
Expand Down
5 changes: 4 additions & 1 deletion admin_tools/dashboard/modules.py
Expand Up @@ -4,7 +4,6 @@

from django.apps import apps as django_apps
from django.core.urlresolvers import reverse
from django.contrib.contenttypes.models import ContentType
from django.forms.utils import flatatt

from django.utils.itercompat import is_iterable
Expand Down Expand Up @@ -613,6 +612,10 @@ def init_with_context(self, context):
request = context['request']

def get_qset(list):

# Import this here to silence RemovedInDjango19Warning. See #15
from django.contrib.contenttypes.models import ContentType

qset = None
for contenttype in list:
if isinstance(contenttype, ContentType):
Expand Down

1 comment on commit 9470008

@izimobil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merged.

Please sign in to comment.