Skip to content
Snippets Groups Projects
Commit a82d785c authored by Valentin Groues's avatar Valentin Groues :eyes:
Browse files

change some appointment types descriptions - fixes #98

parent b775ff2d
No related branches found
No related tags found
No related merge requests found
Pipeline #
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2017-04-20 14:35
from __future__ import unicode_literals
from django.db import migrations
updates_to_perform = [
("SB", "Skin Biopsy", "Level B Skin Biopsy"),
("B", "Level B NP", "Level B"),
("PSP", "Level B PSP", "PSP"),
]
def add_prefixes(apps, schema_editor):
AppointmentType = apps.get_model("web", "AppointmentType")
for update_to_perform in updates_to_perform:
code, description, _ = update_to_perform
appointment_type = AppointmentType.objects.filter(code=code).first()
if appointment_type is not None:
appointment_type.description = description
appointment_type.save()
def revert_prefixes(apps, schema_editor):
AppointmentType = apps.get_model("web", "AppointmentType")
for update_to_perform in updates_to_perform:
code, _, previous_description = update_to_perform
appointment_type = AppointmentType.objects.filter(code=code).first()
if appointment_type is not None:
appointment_type.description = previous_description
appointment_type.save()
class Migration(migrations.Migration):
dependencies = [
('web', '0036_year_of_diagnosis_default'),
]
operations = [
migrations.RunPython(add_prefixes, reverse_code=revert_prefixes),
]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment