diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-05-09 10:41:44 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-06-13 18:16:05 +0200 |
commit | 5b0c5f805eb444269668e318082ec7809719ff8f (patch) | |
tree | 35d048c9a4568937785cabb3a8fc669998d5f323 /ishtar_common/forms_common.py | |
parent | 2213cdd8fd06f5df85c14fd7306ba2fdfab831e2 (diff) | |
download | Ishtar-5b0c5f805eb444269668e318082ec7809719ff8f.tar.bz2 Ishtar-5b0c5f805eb444269668e318082ec7809719ff8f.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 c9621d21c..37f037df1 100644 --- a/ishtar_common/forms_common.py +++ b/ishtar_common/forms_common.py @@ -3469,3 +3469,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 |