mirror of
https://github.com/Hopiu/django-cachalot.git
synced 2026-05-10 13:44:44 +00:00
Simplification.
This commit is contained in:
parent
009b7ca557
commit
42fc5d2f0e
1 changed files with 1 additions and 3 deletions
|
|
@ -4,8 +4,6 @@ from django.conf import settings
|
|||
class PostgresRouter(object):
|
||||
@staticmethod
|
||||
def in_postgres(model):
|
||||
if model is None:
|
||||
return False
|
||||
app_label = model._meta.app_label
|
||||
model_name = model._meta.model_name
|
||||
return app_label == 'cachalot' and model_name == 'postgresmodel'
|
||||
|
|
@ -15,5 +13,5 @@ class PostgresRouter(object):
|
|||
else 'default')
|
||||
|
||||
def allow_migrate(self, db, app_label, model=None, **hints):
|
||||
if self.in_postgres(model):
|
||||
if model is not None and self.in_postgres(model):
|
||||
return db == self.get_postgresql_alias()
|
||||
|
|
|
|||
Loading…
Reference in a new issue