model_name can be non-None, and model is still None

This commit is contained in:
Ned Batchelder
2017-02-14 12:48:33 -05:00
parent 583cd26f11
commit 52ca02fdc4

View File

@@ -51,7 +51,7 @@ class StudentModuleHistoryExtendedRouter(object):
"""
if model_name is not None:
model = hints.get('model')
if self._is_csmh(model):
if model is not None and self._is_csmh(model):
return db == self.DATABASE_NAME
if db == self.DATABASE_NAME:
return False