-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #849 from lakridserne/feature/776_refactor_members…
…_table Introducer feltet person på aktivitetstilmeldingen, så vi ved hvem der er tilmeldt - erstatter member
- Loading branch information
Showing
5 changed files
with
58 additions
and
7 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
members/management/commands/populate_person_field_on_activityparticipants.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from django.core.management.base import BaseCommand | ||
from members.models.activityparticipant import ActivityParticipant | ||
|
||
|
||
class Command(BaseCommand): | ||
help = "Populates the person field on the activity participants table, so we can remove member in the future" | ||
|
||
def handle(self, *args, **options): | ||
for actpar in ActivityParticipant.objects.all(): | ||
actpar.person = actpar.member.person | ||
actpar.save() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Generated by Django 4.1.6 on 2023-02-26 13:37 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("members", "0036_rename_founded_union_founded_at_union_closed_at"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="activityparticipant", | ||
name="person", | ||
field=models.ForeignKey( | ||
null=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
to="members.person", | ||
verbose_name="Person", | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Generated by Django 4.1.6 on 2023-02-26 15:33 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("members", "0037_activityparticipant_person"), | ||
("members", "0037_alter_waitinglist_options"), | ||
] | ||
|
||
operations = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters