Skip to content

Commit

Permalink
Change the UK Staff Location filter to only show DBT locations
Browse files Browse the repository at this point in the history
Remove the unique_location_name constraint
  • Loading branch information
CamLamb committed Sep 21, 2023
1 parent 3d2acd1 commit 65fef72
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/peoplefinder/forms/profile_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,7 @@ class Meta:
queryset=UkStaffLocation.objects.all()
.filter(
organisation__in=[
"Department for International Trade",
"Department for Business, Energy and Industrial Strategy",
"Department for Business and Trade",
]
)
.order_by(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 4.1.10 on 2023-09-21 11:45

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("peoplefinder", "0112_alter_person_preferred_first_name"),
]

operations = [
migrations.RemoveConstraint(
model_name="ukstafflocation",
name="unique_location_name",
),
migrations.AlterField(
model_name="ukstafflocation",
name="code",
field=models.CharField(max_length=255, unique=True),
),
]
3 changes: 1 addition & 2 deletions src/peoplefinder/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,10 @@ class UkStaffLocation(IngestedModel):
class Meta:
constraints = [
models.UniqueConstraint(fields=["code"], name="unique_location_code"),
models.UniqueConstraint(fields=["name"], name="unique_location_name"),
]
ordering = ["name"]

code = models.CharField(max_length=255)
code = models.CharField(max_length=255, unique=True)
name = models.CharField(max_length=255)
city = models.CharField(max_length=255)
organisation = models.CharField(max_length=255)
Expand Down

0 comments on commit 65fef72

Please sign in to comment.