Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not assume active DB when not specified #210

Merged
merged 14 commits into from
Nov 26, 2022
Merged
6 changes: 4 additions & 2 deletions admin_interface/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ def pre_save_handler(instance, **kwargs):
pass

@staticmethod
def get_active_theme(database="default"):
objs_manager = Theme.objects.using(database)
def get_active_theme(database=None):
objs_manager = (
Theme.objects if database is None else Theme.objects.using(database)
)
objs_active_qs = objs_manager.filter(active=True)
objs_active_ls = list(objs_active_qs)
objs_active_count = len(objs_active_ls)
Expand Down