Skip to content

Commit

Permalink
Merge branch 'master' into rc-paas-migration
Browse files Browse the repository at this point in the history
  • Loading branch information
osimuka authored Jun 14, 2024
2 parents dfb5258 + 192173e commit ef760f8
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 5 deletions.
1 change: 1 addition & 0 deletions api/barriers/serializers/data_workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ class Meta(BarrierSerializerBase.Meta):
"latest_progress_update",
"location",
"reported_by",
"reported_on",
"barrier_owner",
"modified_by",
"modified_on",
Expand Down
32 changes: 32 additions & 0 deletions api/metadata/migrations/0046_auto_20240607_0812.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Generated by Django 4.2.11 on 2024-06-07 08:12

from django.db import migrations


def remove_brexit_and_nip_tags(apps, schema_editor):
"""Removing Brexit and NIP tags to avoid confusion to users because they are no longer relevant."""
BarrierTag = apps.get_model("metadata", "BarrierTag")

BarrierTag.objects.filter(title="Brexit").delete()
BarrierTag.objects.filter(title="NI Protocol").delete()


def create_brexit_and_nip_tags(apps, schema_editor):
"""Creating Brexit and NIP tags."""
BarrierTag = apps.get_model("metadata", "BarrierTag")

BarrierTag.objects.create(title="Brexit")
BarrierTag.objects.create(title="NI Protocol")


class Migration(migrations.Migration):

dependencies = [
("metadata", "0045_programme_fund_tags"),
]

operations = [
migrations.RunPython(
remove_brexit_and_nip_tags, reverse_code=create_brexit_and_nip_tags
),
]
2 changes: 0 additions & 2 deletions tests/metadata/test_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,6 @@ def test_barrier_tags(self):
expected = [
"Scoping (Top 100 priority barrier)",
"COVID-19",
"Brexit",
"NI Protocol",
"Programme Fund",
"International Standards",
"Clean Growth",
Expand Down
6 changes: 3 additions & 3 deletions tests/metadata/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ def test_tag_ordering(self):
assert last_tag.order == new_tag.order

tags = BarrierTag.objects.all()
assert 1 == tags[0].order
assert 2 == tags[1].order
assert 3 == tags[2].order
assert tags[0].order == 1
assert tags[1].order == 2
assert tags[2].order == 6


class TestOrganisations(TestCase):
Expand Down

0 comments on commit ef760f8

Please sign in to comment.