mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-10 13:00:16 +02:00
Ensure entered api ID is int
Auth accepts these values in either order for building the model, but incorrectly assigns the vcode instead of ID to character models if entered incorrectly which can break certain functions. This is an added layer of stupid-protection to make sure they put the API ID (a number) in the right field.
This commit is contained in:
parent
b6446f255e
commit
fa60be3675
@ -16,6 +16,13 @@ class UpdateKeyForm(forms.Form):
|
||||
|
||||
api_id = forms.CharField(max_length=254, required=True, label="Key ID")
|
||||
api_key = forms.CharField(max_length=254, required=True, label="Verification Code")
|
||||
|
||||
def clean_api_id(self):
|
||||
try:
|
||||
api_id = int(self.cleaned_data['api_id'])
|
||||
return api_id
|
||||
except:
|
||||
raise forms.ValidationError("API ID must be a number")
|
||||
|
||||
def clean(self):
|
||||
super(UpdateKeyForm, self).clean()
|
||||
|
Loading…
x
Reference in New Issue
Block a user