summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-04-18 14:05:47 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-04-18 14:05:47 +0200
commit05b46e14d6d2893b936771c4de6d8e4f22238e8a (patch)
treeae35b65a9584734351e8311271b25328fe537af6
parente9816cb2d3ddc4530303a532210cc12782922c83 (diff)
downloadIshtar-05b46e14d6d2893b936771c4de6d8e4f22238e8a.tar.bz2
Ishtar-05b46e14d6d2893b936771c4de6d8e4f22238e8a.zip
Django 1.8: new app management
-rw-r--r--ishtar_common/backend.py6
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