From a7ab927a5fb6515a230d356783185a70079d9db8 Mon Sep 17 00:00:00 2001 From: Justin Lee Date: Tue, 10 Dec 2024 20:47:15 -0500 Subject: [PATCH] fix(misc): import teacher photos should only find staff --- intranet/apps/dataimport/management/commands/import_photos.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intranet/apps/dataimport/management/commands/import_photos.py b/intranet/apps/dataimport/management/commands/import_photos.py index 83b2241ba3e..5a7401b0d7e 100644 --- a/intranet/apps/dataimport/management/commands/import_photos.py +++ b/intranet/apps/dataimport/management/commands/import_photos.py @@ -30,7 +30,7 @@ def handle(self, *args, **options): if IS_STAFF: if "-" in path.stem: last_name, first_name = path.stem.rsplit("-", 1) - user = get_user_model().objects.filter(first_name=first_name, last_name=last_name).first() + user = get_user_model().objects.filter(first_name=first_name, last_name=last_name, user_type__in=["teacher", "counselor"]).first() else: try: int(path.stem)