mirror of
https://github.com/django/django.git
synced 2025-11-25 05:04:26 +00:00
Fixed #28982 -- Simplified code with and/or.
This commit is contained in:
parent
c2d0f8c084
commit
d7b2aa24f7
55 changed files with 98 additions and 218 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue