Skip to content

Commit

Permalink
Merge pull request #101 from forza-mor-rotterdam/validate-fields
Browse files Browse the repository at this point in the history
enable browser validation
  • Loading branch information
mguikema authored Nov 8, 2023
2 parents 0114d6d + fefab26 commit a6ac17f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
22 changes: 15 additions & 7 deletions app/apps/main/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class MeldingAanmakenForm(forms.Form):
widget=forms.TextInput(
attrs={
"class": "form-control",
"size": "10",
}
),
label="Grafnummer",
Expand All @@ -42,6 +43,7 @@ class MeldingAanmakenForm(forms.Form):
widget=forms.TextInput(
attrs={
"class": "form-control",
"size": "10",
}
),
label="Vak",
Expand Down Expand Up @@ -69,7 +71,11 @@ class MeldingAanmakenForm(forms.Form):
)

toelichting = forms.CharField(
widget=forms.Textarea(),
widget=forms.Textarea(
attrs={
"size": "5000",
}
),
label="Toelichting",
required=True,
)
Expand Down Expand Up @@ -98,6 +104,7 @@ class MeldingAanmakenForm(forms.Form):
widget=forms.TextInput(
attrs={
"class": "form-control",
"size": "100",
}
),
label="Naam",
Expand All @@ -110,6 +117,7 @@ class MeldingAanmakenForm(forms.Form):
"type": "tel",
"class": "form-control",
"data-request-target": "phoneField",
"size": "17",
}
),
label="Telefoonnummer",
Expand Down Expand Up @@ -311,22 +319,22 @@ def signaal_data(self, files=[]):

post_data = {
"melder": {
"naam": data.get("naam_melder"),
"naam": data.get("naam_melder", "")[:100],
"email": data.get("email_melder"),
"telefoonnummer": data.get("telefoon_melder"),
"telefoonnummer": data.get("telefoon_melder", "")[:17],
},
"origineel_aangemaakt": now.isoformat(),
"onderwerpen": self.get_onderwerp_urls(data.get("categorie", [])),
"omschrijving_kort": data.get("toelichting", "")[:200],
"omschrijving": data.get("toelichting", ""),
"omschrijving_kort": data.get("toelichting", "")[:500],
"omschrijving": data.get("toelichting", "")[:5000],
"meta": data,
"meta_uitgebreid": labels,
"graven": [
{
"plaatsnaam": "Rotterdam",
"begraafplaats": data.get("begraafplaats"),
"grafnummer": data.get("grafnummer"),
"vak": data.get("vak"),
"grafnummer": data.get("grafnummer", "")[:10],
"vak": data.get("vak", "")[:10],
},
],
}
Expand Down
3 changes: 1 addition & 2 deletions app/apps/main/templates/melding/aanmaken.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ <h1>Serviceverzoek</h1>
id="requestForm"
data-controller="request"
enctype="multipart/form-data"
method="post"
novalidate>
method="post">
{% csrf_token %}

<fieldset>
Expand Down

0 comments on commit a6ac17f

Please sign in to comment.