mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-02-25 15:46:30 +00:00
Compare commits
2 Commits
3e46d06817
...
e3f5541774
Author | SHA1 | Date | |
---|---|---|---|
e3f5541774 | |||
14de6cf824 |
@ -5,6 +5,7 @@ import os
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.management import BaseCommand
|
||||
from django.db.models import Q
|
||||
import requests
|
||||
|
||||
|
||||
@ -46,15 +47,30 @@ class Command(BaseCommand):
|
||||
email = payer["email"]
|
||||
last_name = payer["lastName"]
|
||||
first_name = payer["firstName"]
|
||||
qs = User.objects.filter(email=email)
|
||||
base_filter = Q(
|
||||
registration__participantregistration__isnull=False,
|
||||
registration__participantregistration__team__isnull=False,
|
||||
registration__participantregistration__team__participation__valid=True,
|
||||
)
|
||||
qs = User.objects.filter(
|
||||
base_filter,
|
||||
email=email,
|
||||
)
|
||||
if not qs.exists():
|
||||
qs = User.objects.filter(last_name__icontains=last_name)
|
||||
qs = User.objects.filter(
|
||||
base_filter,
|
||||
last_name__icontains=last_name,
|
||||
)
|
||||
if qs.count() >= 2:
|
||||
qs = qs.filter(first_name__icontains=first_name)
|
||||
if not qs.exists():
|
||||
self.stderr.write(f"Warning: a payment was found by {first_name} {last_name} ({email}), "
|
||||
"but this user is unknown.")
|
||||
continue
|
||||
if qs.count() > 1:
|
||||
self.stderr.write(f"Warning: a payment was found by {first_name} {last_name} ({email}), "
|
||||
f"but there are {qs.count()} matching users.")
|
||||
continue
|
||||
user = qs.get()
|
||||
if not user.registration.participates:
|
||||
self.stderr.write(f"Warning: a payment was found by the email address {email}, "
|
||||
|
21
apps/participation/migrations/0006_auto_20220426_1346.py
Normal file
21
apps/participation/migrations/0006_auto_20220426_1346.py
Normal file
@ -0,0 +1,21 @@
|
||||
# Generated by Django 3.2.13 on 2022-04-26 11:46
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('participation', '0005_pool_results_available'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='solution',
|
||||
options={'ordering': ('participation__team__trigram', 'final_solution', 'problem'), 'verbose_name': 'solution', 'verbose_name_plural': 'solutions'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='synthesis',
|
||||
options={'ordering': ('passage__pool__round', 'type'), 'verbose_name': 'synthesis', 'verbose_name_plural': 'syntheses'},
|
||||
),
|
||||
]
|
18
apps/registration/migrations/0003_alter_payment_type.py
Normal file
18
apps/registration/migrations/0003_alter_payment_type.py
Normal file
@ -0,0 +1,18 @@
|
||||
# Generated by Django 3.2.13 on 2022-04-26 11:46
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('registration', '0002_participantregistration_health_issues'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='payment',
|
||||
name='type',
|
||||
field=models.CharField(blank=True, choices=[('', 'No payment'), ('helloasso', 'Hello Asso'), ('scholarship', 'Scholarship'), ('bank_transfer', 'Bank transfer'), ('other', 'Other (please indicate)'), ('free', 'The tournament is free')], default='', max_length=16, verbose_name='type'),
|
||||
),
|
||||
]
|
@ -333,6 +333,7 @@ class Payment(models.Model):
|
||||
('helloasso', "Hello Asso"),
|
||||
('scholarship', _("Scholarship")),
|
||||
('bank_transfer', _("Bank transfer")),
|
||||
('other', _("Other (please indicate)")),
|
||||
('free', _("The tournament is free")),
|
||||
],
|
||||
blank=True,
|
||||
|
@ -7,7 +7,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: TFJM\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2022-04-22 18:01+0200\n"
|
||||
"POT-Creation-Date: 2022-04-26 13:45+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: Yohann D'ANELLO <yohann.danello@animath.fr>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@ -100,7 +100,7 @@ msgid "Changelog of type \"{action}\" for model {model} at {timestamp}"
|
||||
msgstr "Changelog de type \"{action}\" pour le modèle {model} le {timestamp}"
|
||||
|
||||
#: apps/participation/admin.py:19 apps/participation/models.py:314
|
||||
#: apps/participation/tables.py:44 apps/registration/models.py:358
|
||||
#: apps/participation/tables.py:44 apps/registration/models.py:359
|
||||
msgid "valid"
|
||||
msgstr "valide"
|
||||
|
||||
@ -1326,35 +1326,39 @@ msgid "Bank transfer"
|
||||
msgstr "Virement bancaire"
|
||||
|
||||
#: apps/registration/models.py:336
|
||||
msgid "Other (please indicate)"
|
||||
msgstr "Autre (veuillez spécifier)"
|
||||
|
||||
#: apps/registration/models.py:337
|
||||
msgid "The tournament is free"
|
||||
msgstr "Le tournoi est gratuit"
|
||||
|
||||
#: apps/registration/models.py:343
|
||||
#: apps/registration/models.py:344
|
||||
msgid "scholarship file"
|
||||
msgstr "Notification de bourse"
|
||||
|
||||
#: apps/registration/models.py:344
|
||||
#: apps/registration/models.py:345
|
||||
msgid "only if you have a scholarship."
|
||||
msgstr "Nécessaire seulement si vous déclarez être boursier."
|
||||
|
||||
#: apps/registration/models.py:351
|
||||
#: apps/registration/models.py:352
|
||||
msgid "additional information"
|
||||
msgstr "informations additionnelles"
|
||||
|
||||
#: apps/registration/models.py:352
|
||||
#: apps/registration/models.py:353
|
||||
msgid "To help us to find your payment."
|
||||
msgstr "Pour nous aider à retrouver votre paiement, si nécessaire."
|
||||
|
||||
#: apps/registration/models.py:367
|
||||
#: apps/registration/models.py:368
|
||||
#, python-brace-format
|
||||
msgid "Payment of {registration}"
|
||||
msgstr "Paiement de {registration}"
|
||||
|
||||
#: apps/registration/models.py:370
|
||||
#: apps/registration/models.py:371
|
||||
msgid "payment"
|
||||
msgstr "paiement"
|
||||
|
||||
#: apps/registration/models.py:371
|
||||
#: apps/registration/models.py:372
|
||||
msgid "payments"
|
||||
msgstr "paiements"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user