diff options
-rw-r--r-- | ishtar_common/backend.py | 6 |
1 files changed, 3 insertions, 3 deletions
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 <etienne.loks_AT_peacefrogsDOTnet> +# Copyright (C) 2010-2017 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet> # 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 |