Added validation to stop exploiting the multi-character hole

This commit is contained in:
2010-03-12 13:12:17 +00:00
parent 2d8856c742
commit d25d53273d

View File

@@ -37,6 +37,12 @@ def UserServiceAccountForm(user):
character = forms.ChoiceField(chars)
service = forms.ChoiceField(services)
def clean(self):
if not self.cleaned_data['character'].corporation.group in self.cleaned_data['service'].groups.all():
raise form.ValidationError("%s is not in a corporation allowed to access %s" % (self.cleaned_data['character'].name, self.cleaned_data['service'])
return self.cleaned_data
return ServiceAccountForm
class RedditAccountForm(forms.Form):