From 0af161131d9d406c7026ca135103a8f8d826e714 Mon Sep 17 00:00:00 2001 From: Brian Mesick Date: Tue, 12 Mar 2024 10:36:22 -0400 Subject: [PATCH] fix: Stop using testing code --- .../management/commands/load_test_tracking_events.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/platform_plugin_aspects/management/commands/load_test_tracking_events.py b/platform_plugin_aspects/management/commands/load_test_tracking_events.py index 8095c9d..6f6969e 100644 --- a/platform_plugin_aspects/management/commands/load_test_tracking_events.py +++ b/platform_plugin_aspects/management/commands/load_test_tracking_events.py @@ -41,12 +41,13 @@ class LoadTest: def __init__(self, num_users: int, username_prefix: str): course_shortname = str(uuid.uuid4())[:6] - self.instructor = User.objects.create_user( - f"instructor_{course_shortname}", + self.instructor = self.create_user( + username=f"instructor_{course_shortname}", password="aspects", email=f"instructor_{course_shortname}@openedx.invalid", is_active=True ) + self.instructor.is_active = True self.instructor.save() start_date = datetime.now() - timedelta(days=7) @@ -96,7 +97,9 @@ def create_user(self, **user_data): tos_required=False ) - (user, _, _) = do_create_account(account_creation_form) + user, _, _ = do_create_account(account_creation_form) + user.is_active = True + user.save() return user def trigger_events(