diff --git a/apps/scripts b/apps/scripts index b9fdced3..578bd892 160000 --- a/apps/scripts +++ b/apps/scripts @@ -1 +1 @@ -Subproject commit b9fdced3c2ce34168b8f0d6004a20a69ca16e0de +Subproject commit 578bd892a78440ca99387f518c8029b68bf8f566 diff --git a/apps/wei/management/__init__.py b/apps/wei/management/__init__.py deleted file mode 100644 index 4e945ad5..00000000 --- a/apps/wei/management/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay -# SPDX-License-Identifier: GPL-3.0-or-later diff --git a/apps/wei/management/commands/__init__.py b/apps/wei/management/commands/__init__.py deleted file mode 100644 index 4e945ad5..00000000 --- a/apps/wei/management/commands/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay -# SPDX-License-Identifier: GPL-3.0-or-later diff --git a/apps/wei/management/commands/_private.py b/apps/wei/management/commands/_private.py deleted file mode 100644 index 4e945ad5..00000000 --- a/apps/wei/management/commands/_private.py +++ /dev/null @@ -1,2 +0,0 @@ -# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay -# SPDX-License-Identifier: GPL-3.0-or-later diff --git a/apps/wei/management/commands/extract_ml_registrations.py b/apps/wei/management/commands/extract_ml_registrations.py deleted file mode 100644 index 1b3853a6..00000000 --- a/apps/wei/management/commands/extract_ml_registrations.py +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay -# SPDX-License-Identifier: GPL-3.0-or-later - -from datetime import date - -from django.core.management import BaseCommand -from django.db.models import Q - -from member.models import Membership, Club -from ...models import WEIClub - - -class Command(BaseCommand): - help = "Get mailing list registrations from the last wei. " \ - "Usage: manage.py extract_ml_registrations -t {events,art,sport}. " \ - "You can write this into a file with a pipe, then paste the document into your mail manager." - - def add_arguments(self, parser): - parser.add_argument('--type', '-t', choices=["members", "clubs", "events", "art", "sport"], default="members", - help='Select the type of the mailing list (default members)') - parser.add_argument('--year', '-y', type=int, default=None, - help='Select the year of the concerned WEI. Default: last year') - - def handle(self, *args, **options): - if options["type"] == "members": - for membership in Membership.objects.filter( - club__name="BDE", - date_start__lte=date.today(), - date_end__gte=date.today(), - ).all(): - self.stdout.write(membership.user.email) - return - - if options["type"] == "clubs": - for club in Club.objects.all(): - self.stdout.write(club.email) - return - - if options["year"] is None: - wei = WEIClub.objects.order_by('-year').first() - else: - wei = WEIClub.objects.filter(year=options["year"]) - if wei.exists(): - wei = wei.get() - else: - wei = WEIClub.objects.order_by('-year').first() - self.stderr.write(self.style.WARNING("Warning: there was no WEI in year " + str(options["year"]) + ". " - + "Assuming the last WEI (year " + str(wei.year) + ")")) - q = Q(ml_events_registration=True) if options["type"] == "events" else Q(ml_art_registration=True)\ - if options["type"] == "art" else Q(ml_sport_registration=True) - registrations = wei.users.filter(q) - for registration in registrations.all(): - self.stdout.write(registration.user.email) diff --git a/apps/wei/management/commands/wei_algorithm.py b/apps/wei/management/commands/wei_algorithm.py deleted file mode 100644 index 1c910e4c..00000000 --- a/apps/wei/management/commands/wei_algorithm.py +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay -# SPDX-License-Identifier: GPL-3.0-or-later - -from django.core.management import BaseCommand - -from ...forms import CurrentSurvey - - -class Command(BaseCommand): - help = "Attribute to each first year member a bus for the WEI" - - def handle(self, *args, **options): - """ - Run the WEI algorithm to attribute a bus to each first year member. - """ - CurrentSurvey.get_algorithm_class()().run_algorithm()