Added more validation for Eve API input

This commit is contained in:
2010-03-03 15:09:15 +00:00
parent 91bd276ace
commit ae11b45133

View File

@@ -10,6 +10,9 @@ class EveAPIForm(forms.Form):
description = forms.CharField(max_length=100)
def clean(self):
if not self.cleaned_data['user_id'].isdigit():
raise forms.ValidationError("API User ID provided is not valid")
try:
eaccount = EVEAccount.objects.get(api_user_id=self.cleaned_data['user_id'])
except EVEAccount.DoesNotExist: