diff options
Diffstat (limited to 'ishtar_common/backend.py')
| -rw-r--r-- | ishtar_common/backend.py | 8 | 
1 files changed, 4 insertions, 4 deletions
| diff --git a/ishtar_common/backend.py b/ishtar_common/backend.py index f48e6ddec..261e4dc6f 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,8 +55,8 @@ class ObjectPermBackend(ModelBackend):          if obj is None:              model_name = perm.split('_')[-1].lower()              model = None -            for app in cache.get_apps(): -                for modl in cache.get_models(app): +            for app in apps.get_apps(): +                for modl in apps.get_models(app):                      if modl.__name__.lower() == model_name:                          model = modl              if not model: | 
