diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-05-09 10:41:44 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-10-15 19:32:59 +0200 |
commit | 16146deb2e76bb77f9566e0c3d5f21fd98d0f65c (patch) | |
tree | 0aeb1358e2cc4a640845885e1179390b7656f54f /ishtar_common/forms_common.py | |
parent | 99ca4cbcf573cdd80ab525d573b1f0e3ab738057 (diff) | |
download | Ishtar-16146deb2e76bb77f9566e0c3d5f21fd98d0f65c.tar.bz2 Ishtar-16146deb2e76bb77f9566e0c3d5f21fd98d0f65c.zip |
✨ GIS API: manage GIS connections (list, request token, create token, delete)
Diffstat (limited to 'ishtar_common/forms_common.py')
-rw-r--r-- | ishtar_common/forms_common.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py index 757e3dc85..007be5fe0 100644 --- a/ishtar_common/forms_common.py +++ b/ishtar_common/forms_common.py @@ -3481,3 +3481,17 @@ class PreGISForm(IshtarForm): self.fields["back_url"] = forms.CharField( label="", required=False, widget=forms.HiddenInput, initial=back_url ) + + +class GisRequestForm(IshtarForm): + access_type = forms.ChoiceField( + label=_("New access type"), choices=models_rest.API_ACCESS_TYPES + ) + name = forms.CharField(label=_("Name"), max_length=150) + limit_date = DateField(label=_("Limit date"), required=False) + + def clean(self): + data = self.cleaned_data + if data.get("limit_date", None) and data["limit_date"] < datetime.date.today(): + raise forms.ValidationError(_("Limit date cannot be in the past.")) + return data |