Skip to content

Commit

Permalink
Merge pull request #1500 from york-stsci/fix_router
Browse files Browse the repository at this point in the history
Fixed the monitors DB router
  • Loading branch information
mfixstsci authored Feb 26, 2024
2 parents 2680c2e + d760589 commit ec02a52
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions jwql/website/apps/jwql/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ def allow_migrate(self, db, app_label, model_name=None, **hints):
Make sure the monitors apps only appear in the 'monitors' database.
"""
model_names = [name.replace("_", "") for name in MONITOR_TABLE_NAMES]
if app_label == 'jwql' and model_name in model_names:
return db == "monitors"
if app_label == 'jwql':
if model_name in model_names:
if db == "monitors":
return True
return False
elif db == "monitors":
return False
return None

0 comments on commit ec02a52

Please sign in to comment.