forked from ubccr/coldfront
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ubccr#294: Created a data migration file so that existing ColdFront i…
…nstances, can get the allocation change status choices loaded into their application automatically
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
coldfront/core/allocation/migrations/0005_auto_20211117_1413.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,20 @@ | ||
# Generated by Django 2.2.24 on 2021-11-17 19:13 | ||
|
||
from django.db import migrations | ||
|
||
|
||
def create_status_choices(apps, schema_editor): | ||
AllocationChangeStatusChoice = apps.get_model('allocation', "AllocationChangeStatusChoice") | ||
for choice in ('Pending', 'Approved', 'Denied',): | ||
AllocationChangeStatusChoice.objects.get_or_create(name=choice) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('allocation', '0004_auto_20211102_1017'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(create_status_choices), | ||
] |
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