summaryrefslogtreecommitdiff
path: root/tests/multiple_database
diff options
context:
space:
mode:
authorДилян Палаузов <Dilyan.Palauzov@db.com>2018-01-03 18:52:12 -0500
committerTim Graham <timograham@gmail.com>2018-01-03 20:12:23 -0500
commitd7b2aa24f75434c2ce50100cfef3586071e0747a (patch)
tree9074eb7522888e744f948c52174f367a4281c200 /tests/multiple_database
parentc2d0f8c084456b5073252a91eeb09ab3d7453b18 (diff)
downloaddjango-d7b2aa24f75434c2ce50100cfef3586071e0747a.tar.gz
Fixed #28982 -- Simplified code with and/or.
Diffstat (limited to 'tests/multiple_database')
-rw-r--r--tests/multiple_database/routers.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/tests/multiple_database/routers.py b/tests/multiple_database/routers.py
index cb12a907c9..7891e22969 100644
--- a/tests/multiple_database/routers.py
+++ b/tests/multiple_database/routers.py
@@ -43,9 +43,7 @@ class AuthRouter:
def allow_relation(self, obj1, obj2, **hints):
"Allow any relation if a model in Auth is involved"
- if obj1._meta.app_label == 'auth' or obj2._meta.app_label == 'auth':
- return True
- return None
+ return obj1._meta.app_label == 'auth' or obj2._meta.app_label == 'auth' or None
def allow_migrate(self, db, app_label, **hints):
"Make sure the auth app only appears on the 'other' db"