def clean(self):
cleaned_data = super(AuthForm, self).clean()<EOL>user = self.get_user()<EOL>if self.staff_only and (not user or not user.is_staff):<EOL><INDENT>raise forms.ValidationError('<STR_LIT>')<EOL><DEDENT>if self.superusers_only and (not user or not user.is_superuser):<EOL><INDENT>raise forms.ValidationError('<STR_LIT>')<EOL><DEDENT>return cleaned_data<EOL>
When receiving the filled out form, check for valid access.