From 05b46e14d6d2893b936771c4de6d8e4f22238e8a Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 18 Apr 2017 14:05:47 +0200 Subject: Django 1.8: new app management --- ishtar_common/backend.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ishtar_common/backend.py') diff --git a/ishtar_common/backend.py b/ishtar_common/backend.py index f48e6ddec..67218ffca 100644 --- a/ishtar_common/backend.py +++ b/ishtar_common/backend.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# Copyright (C) 2010-2013 Étienne Loks +# Copyright (C) 2010-2017 Étienne Loks # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -23,7 +23,7 @@ Permission backend to manage "own" objects from django.contrib.auth.backends import ModelBackend from django.core.exceptions import ObjectDoesNotExist -from django.db.models.loading import cache +from django.apps import apps import models @@ -55,7 +55,7 @@ class ObjectPermBackend(ModelBackend): if obj is None: model_name = perm.split('_')[-1].lower() model = None - for app in cache.get_apps(): + for app in apps.get_apps(): for modl in cache.get_models(app): if modl.__name__.lower() == model_name: model = modl -- cgit v1.2.3