diff --git a/users/actions.py b/users/actions.py index 12313f5c5..5b6ebb438 100644 --- a/users/actions.py +++ b/users/actions.py @@ -5,7 +5,7 @@ def export_csv(modeladmin, request, queryset): membership_name = { - 0: 'Basic', 1: 'Supporting', 2: 'Sponsor', 3: 'Managing', + 0: 'Basic', 1: 'Supporting', 2: 'Sponsor', 4: 'Contributing', 5: 'Fellow' } response = HttpResponse(content_type='text/csv') diff --git a/users/migrations/0016_auto_20250121_2256.py b/users/migrations/0016_auto_20250121_2256.py new file mode 100644 index 000000000..eda3e36e4 --- /dev/null +++ b/users/migrations/0016_auto_20250121_2256.py @@ -0,0 +1,24 @@ +# Generated by Django 4.2.17 on 2025-01-21 22:56 + +# Data migration: Merge MANAGING (3) membership_type into CONTRIBUTING (4) + +from django.db import migrations + + +def update_membership_level(apps, schema_editor): + Membership = apps.get_model('users', 'Membership') + Membership.objects.filter(membership_type=3).update(membership_type=4) + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0015_alter_user_first_name'), + ] + + operations = [ + migrations.RunPython( + update_membership_level, + migrations.RunPython.noop + ) + ] diff --git a/users/migrations/0017_alter_membership_membership_type.py b/users/migrations/0017_alter_membership_membership_type.py new file mode 100644 index 000000000..0576c0761 --- /dev/null +++ b/users/migrations/0017_alter_membership_membership_type.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.17 on 2025-01-22 03:20 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0016_auto_20250121_2256'), + ] + + operations = [ + migrations.AlterField( + model_name='membership', + name='membership_type', + field=models.IntegerField(choices=[(0, 'Basic Member'), (1, 'Supporting Member'), (2, 'Sponsor Member'), (4, 'Contributing Member'), (5, 'Fellow')], default=0), + ), + ] diff --git a/users/models.py b/users/models.py index d80f5ceef..9865ab944 100644 --- a/users/models.py +++ b/users/models.py @@ -77,7 +77,6 @@ class Membership(models.Model): BASIC = 0 SUPPORTING = 1 SPONSOR = 2 - MANAGING = 3 CONTRIBUTING = 4 FELLOW = 5 @@ -85,7 +84,6 @@ class Membership(models.Model): (BASIC, 'Basic Member'), (SUPPORTING, 'Supporting Member'), (SPONSOR, 'Sponsor Member'), - (MANAGING, 'Managing Member'), (CONTRIBUTING, 'Contributing Member'), (FELLOW, 'Fellow'), )