mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-15 15:22:17 +00:00
Added more validation for Eve API input
This commit is contained in:
@@ -10,6 +10,9 @@ class EveAPIForm(forms.Form):
|
|||||||
description = forms.CharField(max_length=100)
|
description = forms.CharField(max_length=100)
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
|
if not self.cleaned_data['user_id'].isdigit():
|
||||||
|
raise forms.ValidationError("API User ID provided is not valid")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
eaccount = EVEAccount.objects.get(api_user_id=self.cleaned_data['user_id'])
|
eaccount = EVEAccount.objects.get(api_user_id=self.cleaned_data['user_id'])
|
||||||
except EVEAccount.DoesNotExist:
|
except EVEAccount.DoesNotExist:
|
||||||
|
|||||||
Reference in New Issue
Block a user