Skip to content

Commit

Permalink
#3512 - old managment command using obsolete code
Browse files Browse the repository at this point in the history
  • Loading branch information
davmlaw committed Sep 26, 2023
1 parent 2535dd7 commit 31f7dfa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions classification/management/commands/labs_and_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from django.core.management.base import BaseCommand

from snpdb.models.models import Lab, Organization
from snpdb.models.models_user_settings import UserSettings
from snpdb.models.models_user_settings import UserSettings, UserSettingsOverride

module_dir = os.path.dirname(__file__) # get current directory
lab_path = os.path.join(module_dir, 'labs.csv')
Expand Down Expand Up @@ -89,10 +89,10 @@ def ensure_users():
if legacy_lab:
user.groups.add(legacy_lab.group)

user_settings = UserSettings.get_for_user(user)
if not user_settings.default_lab:
user_settings.default_lab = lab
user_settings.save()
user_settings_override, _ = UserSettingsOverride.objects.get_or_create(user=user)
if not user_settings_override.default_lab:
user_settings_override.default_lab = lab
user_settings_override.save()

user.save()

Expand Down

0 comments on commit 31f7dfa

Please sign in to comment.