mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-16 15:06:00 +02:00
Pré-injection du BDA
This commit is contained in:
parent
067dd6f9d1
commit
f60dc8cfa0
46
apps/member/migrations/0014_create_bda.py
Normal file
46
apps/member/migrations/0014_create_bda.py
Normal file
@ -0,0 +1,46 @@
|
||||
from django.db import migrations
|
||||
|
||||
def create_bda(apps, schema_editor):
|
||||
"""
|
||||
The club BDA is now pre-injected.
|
||||
"""
|
||||
Club = apps.get_model("member", "club")
|
||||
NoteClub = apps.get_model("note", "noteclub")
|
||||
Alias = apps.get_model("note", "alias")
|
||||
ContentType = apps.get_model('contenttypes', 'ContentType')
|
||||
polymorphic_ctype_id = ContentType.objects.get_for_model(NoteClub).id
|
||||
|
||||
Club.objects.get_or_create(
|
||||
id=10,
|
||||
name="BDA",
|
||||
email="bda.ensparissaclay@gmail.com",
|
||||
require_memberships=True,
|
||||
membership_fee_paid=750,
|
||||
membership_fee_unpaid=750,
|
||||
membership_duration=396,
|
||||
membership_start="2024-08-01",
|
||||
membership_end="2025-09-30",
|
||||
)
|
||||
NoteClub.objects.get_or_create(
|
||||
id=1937,
|
||||
club_id=10,
|
||||
polymorphic_ctype_id=polymorphic_ctype_id,
|
||||
)
|
||||
Alias.objects.get_or_create(
|
||||
id=1937,
|
||||
note_id=1937,
|
||||
name="BDA",
|
||||
normalized_name="bda",
|
||||
)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('member', '0013_auto_20240801_1436'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(create_bda),
|
||||
]
|
||||
|
Loading…
x
Reference in New Issue
Block a user