Skip to content

Commit

Permalink
Remove KUVA as a standalone areasearch lessor
Browse files Browse the repository at this point in the history
KuVa is represented as the three sub units LIPA, UPA, and NUP.

Also, remove obsolete mapping for removed intended uses.
  • Loading branch information
juho-kettunen-nc committed Dec 16, 2024
1 parent eab5b32 commit 7da645c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
2 changes: 0 additions & 2 deletions plotsearch/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ class AreaSearchLessor(str, Enum):
"""

AKV = "AKV"
KUVA = "KUVA"
MAKE = "MAKE"
LIPA = "LIPA"
UPA = "UPA"
NUP = "NUP"

class Labels:
AKV = pgettext_lazy("Area search lessor", "Area use and control")
KUVA = pgettext_lazy("Area search lessor", "Culture and leisure")
MAKE = pgettext_lazy("Area search lessor", "Development of land assets")
LIPA = pgettext_lazy("Area search lessor", "Sports venue services")
UPA = pgettext_lazy("Area search lessor", "Outdoor services")
Expand Down
13 changes: 1 addition & 12 deletions plotsearch/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@


def map_intended_use_to_lessor(intended_use):
# Keeping these for a transformation period
old_intended_uses_with_lessors = {
"myynti- ja mainontapaikat": AreaSearchLessor.AKV,
"taide- ja kulttuuripaikat": AreaSearchLessor.AKV,
"varasto- ja jakelualueet": AreaSearchLessor.AKV,
"työmaa tukikohdat ja alueet": AreaSearchLessor.AKV,
"veneily ja laiturialueet": AreaSearchLessor.KUVA,
"urheilu- ja liikuntapaikat": AreaSearchLessor.KUVA,
}
intended_uses_with_lessors = {
"ravitsemus, myynti ja mainonta": AreaSearchLessor.AKV,
"taide ja kulttuuri": AreaSearchLessor.AKV,
Expand All @@ -25,9 +16,7 @@ def map_intended_use_to_lessor(intended_use):
"urheilu ja liikunta": AreaSearchLessor.LIPA,
}
try:
lessor = {**intended_uses_with_lessors, **old_intended_uses_with_lessors}.get(
intended_use.name.lower(), None
)
lessor = intended_uses_with_lessors.get(intended_use.name.lower(), None)
except AttributeError:
return None

Expand Down

0 comments on commit 7da645c

Please sign in to comment.