mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 06:42:16 +00:00
Added validation to stop exploiting the multi-character hole
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user