def clean(self):
    super(SomeForm, self).clean()
canchangedriver = self.instance.somefunc()
if canchangedriver or sorted(self.instance.drivers.all()) == sorted(self.
    instance.olddrivers):
    return True
else:
    raise ValidationError()
django: exclude certain form elements based on a condition