events: stop spam (#7611)
* events: don't log updates to internal service accounts Signed-off-by: Jens Langhammer <jens@goauthentik.io> * dont log reputation updates Signed-off-by: Jens Langhammer <jens@goauthentik.io> * don't actually ignore things, stop updating outpost user when not required Signed-off-by: Jens Langhammer <jens@goauthentik.io> * prevent updating internal service account users Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix setattr call Signed-off-by: Jens Langhammer <jens@goauthentik.io> --------- Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
@ -171,6 +171,11 @@ class UserSerializer(ModelSerializer):
|
||||
raise ValidationError("Setting a user to internal service account is not allowed.")
|
||||
return user_type
|
||||
|
||||
def validate(self, attrs: dict) -> dict:
|
||||
if self.instance and self.instance.type == UserTypes.INTERNAL_SERVICE_ACCOUNT:
|
||||
raise ValidationError("Can't modify internal service account users")
|
||||
return super().validate(attrs)
|
||||
|
||||
class Meta:
|
||||
model = User
|
||||
fields = [
|
||||
|
||||
Reference in New Issue
Block a user