Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This fixes #1419 by rewording 'lc' curriculum, and adding 'lc-other'.
- Loading branch information
1 parent
5b5be4f
commit a517556
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
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,36 @@ | ||
# Generated by Django 2.1.2 on 2018-12-05 17:21 | ||
|
||
from django.db import migrations | ||
|
||
|
||
def change_LC_curricula(apps, schema_editor): | ||
"""Populate database with Curriculum objects.""" | ||
Curriculum = apps.get_model('workshops', 'Curriculum') | ||
data = { | ||
'lc': dict( | ||
name='Library Carpentry (Intro to Data, Unix Shell, Git, and/or ' | ||
'OpenRefine)', | ||
active=True, | ||
unknown=False, | ||
), | ||
'lc-other': dict( | ||
name='Library Carpentry (other)', | ||
active=True, | ||
unknown=False, | ||
), | ||
} | ||
for slug, defaults in data.items(): | ||
Curriculum.objects.update_or_create( | ||
slug=slug, | ||
defaults=defaults, | ||
) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
('workshops', '0167_auto_20181116_1814'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(change_LC_curricula) | ||
] |