diff --git a/cadasta/spatial/forms.py b/cadasta/spatial/forms.py index a537e4661..9735e5712 100644 --- a/cadasta/spatial/forms.py +++ b/cadasta/spatial/forms.py @@ -9,7 +9,7 @@ from leaflet.forms.widgets import LeafletWidget from core.util import ID_FIELD_LENGTH from party.models import Party, TenureRelationship, TenureRelationshipType -from .models import SpatialUnit +from .models import SpatialUnit, TYPE_CHOICES from .widgets import SelectPartyWidget, NewEntityWidget @@ -21,6 +21,9 @@ class LocationForm(AttributeModelForm): 'provided on the left side of the map to mark your ' 'new location.')} ) + type = forms.ChoiceField( + choices=filter(lambda c: c[0] != 'PX', TYPE_CHOICES) + ) attributes_field = 'attributes' class Meta: diff --git a/cadasta/spatial/tests/test_forms.py b/cadasta/spatial/tests/test_forms.py index f55dcdd88..86d64ea58 100644 --- a/cadasta/spatial/tests/test_forms.py +++ b/cadasta/spatial/tests/test_forms.py @@ -32,6 +32,7 @@ def test_create_location(self): form.is_valid() form.save() + assert all([c[0] != 'PX' for c in form.fields['type'].choices]) assert SpatialUnit.objects.filter(project=project).count() == 1 def test_create_location_with_attributes(self):