diff --git a/backend/api/management/commands/make_admin.py b/backend/api/management/commands/make_admin.py index 33d1702e..5a590e01 100644 --- a/backend/api/management/commands/make_admin.py +++ b/backend/api/management/commands/make_admin.py @@ -1,5 +1,5 @@ from django.core.management.base import BaseCommand -from api.models.student import Student +from authentication.models import User class Command(BaseCommand): @@ -11,10 +11,10 @@ def add_arguments(self, parser): def handle(self, *args, **options): username = options['username'] - student = Student.objects.filter(username=username) - if student.count() == 0: + user = User.objects.filter(username=username) + if user.count() == 0: self.stdout.write(self.style.ERROR('User not found, first log in !')) return - student = student.get() - student.make_admin() + user = user.get() + user.make_admin() self.stdout.write(self.style.SUCCESS('Successfully made the user admin!')) diff --git a/backend/api/management/commands/seed_db.py b/backend/api/management/commands/seed_db.py index 58425bd3..923fc321 100644 --- a/backend/api/management/commands/seed_db.py +++ b/backend/api/management/commands/seed_db.py @@ -491,25 +491,25 @@ def seed_data(self, amount, provider_function, update_function): def handle(self, *args, **options): start_time = time.time() # TODO maybey take as option - amount_of_students = 50_000 - amount_of_assistants = 300 - amount_of_teachers = 500 - amount_of_courses = 1_000 - amount_of_projects = 3_000 - amount_of_groups = 9_000 - amount_of_submissions = 50_000 - amount_of_file_extensions = 20 - amount_of_structure_checks = 12_000 - - # amount_of_students = 0 - # amount_of_assistants = 0 - # amount_of_teachers = 0 - # amount_of_courses = 1 - # amount_of_projects = 0 - # amount_of_groups = 0 - # amount_of_submissions = 0 - # amount_of_file_extensions = 0 - # amount_of_structure_checks = 0 + # amount_of_students = 50_000 + # amount_of_assistants = 300 + # amount_of_teachers = 500 + # amount_of_courses = 1_000 + # amount_of_projects = 3_000 + # amount_of_groups = 9_000 + # amount_of_submissions = 50_000 + # amount_of_file_extensions = 20 + # amount_of_structure_checks = 12_000 + + amount_of_students = 0 + amount_of_assistants = 0 + amount_of_teachers = 0 + amount_of_courses = 0 + amount_of_projects = 30_000 + amount_of_groups = 0 + amount_of_submissions = 0 + amount_of_file_extensions = 0 + amount_of_structure_checks = 0 self.seed_data(amount_of_students, fake.provide_student, update_Student_providers) self.stdout.write(self.style.SUCCESS('Successfully seeded students!'))