Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add models #40

Merged
merged 7 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ down:
build:
docker compose build

shell:
docker compose exec web bash

collectstatic:
docker compose -f docker-compose.yml -f docker-compose-local.yml run --rm --service-ports --entrypoint "python manage.py collectstatic --noinput" web
docker compose -f docker-compose.yml -f docker-compose-local.yml run --rm --service-ports --entrypoint "python manage.py collectstatic --noinput" web

makemigrations:
docker compose run --entrypoint "python manage.py makemigrations" web

migrate-devserver:
docker exec -it domains-register-a-govuk-domain-web-1 ./manage.py migrate
85 changes: 81 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ psycopg2-binary = "^2.9.9"
whitenoise = "^6.6.0"
govuk-frontend-django = "^0.4.0"
crispy-forms-gds = "^0.3.0"
django-phonenumber-field = {extras = ["phonenumberslite"], version = "^7.3.0"}
django-simple-history = "^3.5.0"


[tool.poetry.group.dev.dependencies]
Expand Down
26 changes: 7 additions & 19 deletions request_a_govuk_domain/request/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
)

from .utils import organisations_list
from .models.organisation import RegistrantTypeChoices


class NameForm(forms.Form):
Expand Down Expand Up @@ -203,27 +204,14 @@ def __init__(self, *args, **kwargs):


class RegistrantTypeForm(forms.Form):
REGISTRANT_TYPES = (
Choice("central_gov", "Central government department or agency"),
Choice("alb", "Non-departmental body - also known as an arm's length body"),
Choice("fire_service", "Fire service"),
Choice("county_council", "County, borough, metropolitan or district council"),
Choice("parish_council", "Parish, town or community council"),
Choice("village_council", "Neighbourhood or village council"),
Choice("combined_authority", "Combined or unitary authority"),
Choice("pcc", "Police and crime commissioner"),
Choice("joint_authority", "Joint authority"),
Choice("joint_committee", "Joint committee"),
Choice(
"representing_public_sector",
"Representing public sector bodies",
divider="Or",
),
Choice("none", "None of the above"),
)
registrant_types = [
Choice(*item) for item in RegistrantTypeChoices.__members__.items()
]
registrant_types[-1].divider = "Or"
registrant_types.append(Choice("none", "None of the above"))

registrant_type = forms.ChoiceField(
choices=REGISTRANT_TYPES,
choices=registrant_types,
widget=forms.RadioSelect,
label="Your registrant must be from an eligible organisation to get a .gov.uk domain name.",
error_messages={"required": "Please select from one of the choices"},
Expand Down
Loading