Run black on all files

This commit is contained in:
Tom Hubrecht 2023-05-19 14:57:48 +02:00
parent e20d7ca6c2
commit 892bf51163
153 changed files with 12 additions and 163 deletions

View file

@ -211,7 +211,6 @@ class AttributionAdminForm(forms.ModelForm):
class AttributionAdmin(ReadOnlyMixin, admin.ModelAdmin):
list_display = ("id", "spectacle", "participant", "given", "paid")
search_fields = (
"spectacle__title",

View file

@ -2,7 +2,6 @@ import random
class Algorithm(object):
shows = None
ranks = None
origranks = None

View file

@ -81,7 +81,7 @@ class Command(MyBaseCommand):
shows = random.sample(
list(tirage.spectacle_set.all()), tirage.spectacle_set.count() // 2
)
for (rank, show) in enumerate(shows):
for rank, show in enumerate(shows):
choices.append(
ChoixSpectacle(
participant=part,

View file

@ -6,7 +6,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [migrations.swappable_dependency(settings.AUTH_USER_MODEL)]
operations = [

View file

@ -35,7 +35,6 @@ def fill_tirage_fields(apps, schema_editor):
class Migration(migrations.Migration):
dependencies = [("bda", "0001_initial")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("bda", "0002_add_tirage")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("bda", "0003_update_tirage_and_spectacle")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("bda", "0004_mails-rappel")]
operations = [

View file

@ -18,7 +18,6 @@ def forwards_func(apps, schema_editor):
class Migration(migrations.Migration):
dependencies = [("bda", "0005_encoding")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("bda", "0006_add_tirage_switch")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("bda", "0007_extends_spectacle")]
operations = [

View file

@ -6,7 +6,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("bda", "0008_py3")]
operations = [

View file

@ -21,7 +21,6 @@ def forwards_func(apps, schema_editor):
class Migration(migrations.Migration):
dependencies = [("bda", "0009_revente")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("bda", "0010_spectaclerevente_shotgun")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("bda", "0011_tirage_appear_catalogue")]
operations = [

View file

@ -13,7 +13,6 @@ def swap_double_choice(apps, schema_editor):
class Migration(migrations.Migration):
dependencies = [("bda", "0011_tirage_appear_catalogue")]
operations = [

View file

@ -6,7 +6,6 @@ from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("bda", "0012_notif_time"), ("bda", "0012_swap_double_choice")]
operations = []

View file

@ -4,7 +4,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("bda", "0013_merge_20180524_2123")]
operations = [

View file

@ -29,7 +29,6 @@ def set_participant_payment(apps, schema_editor):
class Migration(migrations.Migration):
dependencies = [("bda", "0014_attribution_paid_field")]
operations = [

View file

@ -4,7 +4,6 @@ from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("bda", "0015_move_bda_payment")]
operations = [

View file

@ -4,7 +4,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("bda", "0016_delete_participant_paid")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bda", "0017_participant_accepte_charte"),
]

View file

@ -274,13 +274,13 @@ def do_tirage(tirage_elt, token):
results = Algorithm(data["shows"], data["members"], choices)(token)
# On compte les places attribuées et les déçus
for (_, members, losers) in results:
for _, members, losers in results:
data["total_slots"] += len(members)
data["total_losers"] += len(losers)
# On calcule le déficit et les bénéfices pour le BdA
# FIXME: le traitement de l'opéra est sale
for (show, members, _) in results:
for show, members, _ in results:
deficit = (show.slots - len(members)) * show.price
data["total_sold"] += show.slots * show.price
if deficit >= 0:
@ -293,8 +293,8 @@ def do_tirage(tirage_elt, token):
# so assign a single object for each Participant id
members_uniq = {}
members2 = {}
for (show, members, _) in results:
for (member, _, _, _) in members:
for show, members, _ in results:
for member, _, _, _ in members:
if member.id not in members_uniq:
members_uniq[member.id] = member
members2[member] = []

View file

@ -8,7 +8,6 @@ import bds.models
class Migration(migrations.Migration):
initial = True
dependencies = [migrations.swappable_dependency(settings.AUTH_USER_MODEL)]

View file

@ -9,7 +9,6 @@ def create_bds_buro_group(apps, schema_editor):
class Migration(migrations.Migration):
dependencies = [("bds", "0001_initial")]
operations = [

View file

@ -4,7 +4,6 @@ from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("bds", "0002_bds_group"),
]

View file

@ -4,7 +4,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bds", "0003_staff_permission"),
]

View file

@ -4,7 +4,6 @@ from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("bds", "0004_is_member_cotiz_type"),
]

View file

@ -4,7 +4,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bds", "0005_remove_bdsprofile_certificate_file"),
]

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [migrations.swappable_dependency(settings.AUTH_USER_MODEL)]

View file

@ -4,7 +4,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = []

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("events", "0001_event"),

View file

@ -6,7 +6,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("events", "0002_event_subscribers"),

View file

@ -5,7 +5,6 @@ from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("events", "0003_options_and_extra_fields"),

View file

@ -35,7 +35,7 @@ app_dict = {
"events": "gestion/event_v2/", # the events module is still experimental !
"authens": "gestion/authens/",
}
for (app_name, url_prefix) in app_dict.items():
for app_name, url_prefix in app_dict.items():
if app_name in settings.INSTALLED_APPS:
urlpatterns += [path(url_prefix, include("{}.urls".format(app_name)))]

View file

@ -13,7 +13,6 @@ import gestioncof.cms.models
class Migration(migrations.Migration):
initial = True
dependencies = [

View file

@ -4,7 +4,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("cofcms", "0001_initial")]
operations = [

View file

@ -6,7 +6,6 @@ from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("cofcms", "0002_auto_20190523_1521"),
]

View file

@ -6,7 +6,6 @@ from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("cofcms", "0003_directory_entry_optional_links"),
]

View file

@ -6,7 +6,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [migrations.swappable_dependency(settings.AUTH_USER_MODEL)]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("gestioncof", "0001_initial")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("gestioncof", "0002_enable_unprocessed_demandes")]
operations = [

View file

@ -25,7 +25,6 @@ def create_mail(apps, schema_editor):
class Migration(migrations.Migration):
dependencies = [("gestioncof", "0003_event_image")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("gestioncof", "0004_registration_mail")]
operations = [

View file

@ -6,7 +6,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bda", "0004_mails-rappel"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),

View file

@ -6,7 +6,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("gestioncof", "0006_add_calendar")]
operations = [

View file

@ -10,7 +10,6 @@ def forwards(apps, schema_editor):
class Migration(migrations.Migration):
dependencies = [("gestioncof", "0007_alter_club")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("gestioncof", "0008_py3")]
operations = [migrations.DeleteModel(name="Clipper")]

View file

@ -4,7 +4,6 @@ from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("gestioncof", "0009_delete_clipper")]
operations = [migrations.DeleteModel(name="CustomMail")]

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("gestioncof", "0010_delete_custommail")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("gestioncof", "0010_delete_custommail")]
operations = [migrations.RemoveField(model_name="cofprofile", name="num")]

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("gestioncof", "0011_remove_cofprofile_num"),
("gestioncof", "0011_longer_clippers"),

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("gestioncof", "0012_merge")]
operations = [

View file

@ -6,7 +6,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("gestioncof", "0013_pei")]
operations = [

View file

@ -6,7 +6,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("gestioncof", "0014_cofprofile_mailing_unernestaparis")]
operations = [

View file

@ -16,7 +16,6 @@ def null_clippers_to_empty(apps, schema_editor):
class Migration(migrations.Migration):
dependencies = [("gestioncof", "0015_psql_choices_niveaux")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("gestioncof", "0016_unique_clippers"),

View file

@ -4,7 +4,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("gestioncof", "0017_petitscours_uniqueness"),
]

View file

@ -548,7 +548,6 @@ class ExportMegaOrgasViewTests(MegaHelperMixin, ViewTestCaseMixin, TestCase):
auth_forbidden = [None, "user", "member"]
def test(self):
r = self.client.get(self.url)
self.assertEqual(r.status_code, 200)

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("auth", "0006_require_contenttypes_0002"),
# Following dependency allows using Account model to set up the kfet

View file

@ -7,7 +7,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("auth", "0011_update_proxy_permissions"),
("kfetauth", "0001_initial"),

View file

@ -13,7 +13,6 @@ def existing_groups(apps, schema_editor):
class Migration(migrations.Migration):
dependencies = [
("kfetauth", "0002_kfetgroup_kfetpermission"),
]

View file

@ -11,7 +11,6 @@ class Command(BaseCommand):
parser.add_argument("--file", default="kfet_wagtail_02_19")
def handle(self, *args, **options):
self.stdout.write("Import des données wagtail")
# Nettoyage des données initiales posées par Wagtail dans la migration

View file

@ -11,7 +11,6 @@ import kfet.cms.models
class Migration(migrations.Migration):
dependencies = [
("wagtailcore", "0033_remove_golive_expiry_help_text"),
("wagtailimages", "0019_delete_filter"),

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("kfetcms", "0001_initial")]
operations = [

View file

@ -97,7 +97,6 @@ class KFetStreamBlock(ChoicesStreamBlock):
class KFetPage(Page):
content = StreamField(KFetStreamBlock, verbose_name=_("Contenu"))
# Layout fields

View file

@ -461,7 +461,6 @@ class AddcostForm(forms.Form):
class KFetConfigForm(ConfigForm):
kfet_reduction_cof = forms.DecimalField(
label="Réduction COF",
initial=Decimal("20"),

View file

@ -41,7 +41,6 @@ class Command(BaseCommand):
)
def handle(self, *args, **options):
self.stdout.write("Génération d'opérations")
# Output log vars
@ -74,7 +73,6 @@ class Command(BaseCommand):
opegroup_list = []
for i in range(num_ops):
# Randomly pick account
if random.random() > 0.25:
account = random.choice(accounts)
@ -174,7 +172,6 @@ class Command(BaseCommand):
at_list = []
for i in range(num_transfers):
# Randomly pick time
at = now - timedelta(seconds=random.randint(0, time))

View file

@ -63,7 +63,7 @@ class Command(MyBaseCommand):
created_accounts = 0
team_accounts = 0
for (profile, trigramme) in zip(gaulois, gaulois_trigramme):
for profile, trigramme in zip(gaulois, gaulois_trigramme):
account, created = Account.objects.get_or_create(
trigramme=trigramme,
cofprofile=profile,
@ -74,7 +74,7 @@ class Command(MyBaseCommand):
if profile.user.first_name == "Abraracourcix":
profile.user.groups.add(group_chef)
for (profile, trigramme) in zip(romains, romains_trigramme):
for profile, trigramme in zip(romains, romains_trigramme):
account, created = Account.objects.get_or_create(
trigramme=trigramme,
cofprofile=profile,

View file

@ -9,7 +9,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("gestioncof", "0007_alter_club")]
operations = [

View file

@ -7,7 +7,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("kfet", "0001_initial")]
operations = [

View file

@ -7,7 +7,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("kfet", "0002_auto_20160802_2139")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("kfet", "0003_auto_20160802_2142")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("kfet", "0004_auto_20160802_2144")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("kfet", "0005_auto_20160802_2154")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("kfet", "0006_auto_20160804_0600")]
operations = [

View file

@ -6,7 +6,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("kfet", "0007_auto_20160804_0641")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("kfet", "0008_auto_20160804_1736")]
operations = [

View file

@ -6,7 +6,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("kfet", "0009_auto_20160805_0720")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("kfet", "0010_auto_20160806_2343")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("kfet", "0011_auto_20160807_1720")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("kfet", "0012_settings")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("kfet", "0013_auto_20160807_1840")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("kfet", "0014_auto_20160807_2314")]
operations = [

View file

@ -6,7 +6,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("kfet", "0015_auto_20160807_2324")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("kfet", "0016_settings_value_account")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("kfet", "0017_auto_20160808_0234")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("kfet", "0018_auto_20160808_0341")]
operations = [

View file

@ -7,7 +7,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("kfet", "0019_auto_20160808_0343")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("kfet", "0020_auto_20160808_0450")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("kfet", "0021_auto_20160808_0506")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("kfet", "0022_auto_20160808_0512")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("kfet", "0023_auto_20160808_0535")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("kfet", "0024_settings_value_duration")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("kfet", "0025_auto_20160809_0750")]
operations = [

View file

@ -6,7 +6,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("kfet", "0026_auto_20160809_0810")]
operations = [

View file

@ -6,7 +6,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("kfet", "0027_auto_20160811_0648")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("kfet", "0028_auto_20160820_0146")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("kfet", "0029_genericteamtoken")]
operations = [

View file

@ -5,7 +5,6 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("kfet", "0030_auto_20160821_0029")]
operations = [

Some files were not shown because too many files have changed in this diff Show more